1. "-bash: !": event not found" 比如当我们在 linux 命令行输入echo "Reboot your instance!"时,便会给出标题的错误信息.之所以如此,在于对于 bash !是一个有着特殊含义的字符,常常用来指代之前的命令. $ history | less $ !某一数字 $ !! 运行上一命令 Understanding the exclamation mark (!) in bash 因此,这里 echo…
在linux环境下执行一下代码时 printf "The first '%s,%s!' \n" Hello world 返回结果为“-bash: !”: event not found”. 错误原因:使用printf打印“!”号时,感叹号位于单引号之内造成的.将“!”移至单引号之外,即可解决. 在shell脚本当中如果出现此问题,加上“\”反转意符号即可解决.…