【发布时间】:2011-10-30 14:59:34
【问题描述】:
我正在使用 bash shell
$cat test
a --b
$grep '--b' test
grep: option `--b' is ambiguous
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
$grep "--b" test
grep: option `--b' is ambiguous
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
$grep '\-\-b' test
a --b
第 7 章“输入和输出、文件和命令评估”中的经典 shell 脚本书第 7.7 节引用说
“单引号强制外壳按字面意思处理双引号之间的所有内容”。
那为什么上面的单引号不起作用?
【问题讨论】:
标签: linux bash shell unix scripting