我刚刚在centos 7命令行上发出了一个简单的echo
命令:
echo "what is the worst thing someone has said to you about cloth diaper ? ( hopefully nothing ) here's mine !! :..."
它引发了一个错误:
-bash: syntax error near unexpected token `('
有人可以详细说明吗?
答案 0 :(得分:3)
双引号允许shell扩展变量,例如!!
具有特殊含义。如果您想将所有内容视为文本,请改用单引号。
例如;
$ date
Thu Oct 6 11:14:59 EDT 2016
$ echo "!!"
echo "date"
date
$ echo '!!'
!!