$ cat $PIDFILE
cat (GNU coreutils) 6.10
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Torbjorn Granlund and Richard M. Stallman.
$ cat -- $PIDFILE
cat: --version: No such file or directory
--
告诉cat
不要尝试将其后面的内容解析为命令行选项。$PIDFILE
举个例子,想想如果变量定义为,这两种情况会发生什么PIDFILE="--version"
。在我的机器上,他们给出以下结果:POSIX.1-2017
POSIX还在以下位置指定它: http: //pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html#tag_12_02
另请参阅:https ://unix.stackexchange.com/questions/11376/what-does-double-dash-mean-also-known-as-bare-double-dash