-bash: !": event not found

简介: -bash: !": event not found

在linux环境下执行一下代码时


printf "The first '%s,%s!' \n" Hello world

1

返回结果为“-bash: !”: event not found”。


错误原因:使用printf打印“!”号时,感叹号位于单引号之内造成的。将“!”移至单引号之外,即可解决。


在shell脚本当中如果出现此问题,加上“\”反转意符号即可解决。


目录
相关文章
|
11月前
|
关系型数据库 MySQL Shell
【Linux命令】-bash: mysql: command not found
【Linux命令】-bash: mysql: command not found
123 0
|
Linux Shell Python
-bash: pip: command not found pip命令报错 解决方法(Centos版)
-bash: pip: command not found pip命令报错 解决方法(Centos版)
3798 0
|
3月前
|
Shell Linux 开发工具
Anaconda安装后报错 -bash: conda: command not found 如何处理
【6月更文挑战第26天】Anaconda安装后报错 -bash: conda: command not found 如何处理
643 4
|
3月前
|
Shell Linux 开发工具
Anaconda安装后报错 -bash: conda: command not found 如何处理
【6月更文挑战第17天】Anaconda安装后报错 -bash: conda: command not found 如何处理
199 4
|
3月前
|
Shell Linux 开发工具
Anaconda安装后报错 -bash: conda: command not found 如何处理
【6月更文挑战第20天】Anaconda安装后报错 -bash: conda: command not found 如何处理
215 0
|
4月前
|
Shell Linux
重装yum |-bash: yum: command not found
重装yum |-bash: yum: command not found
304 0
|
4月前
|
Linux Shell
mac/linux提示bash: telnet: command not found
mac/linux提示bash: telnet: command not found
|
4月前
|
Shell 应用服务中间件 开发工具
bash: vi: command not found
bash: vi: command not found
|
Shell
bash: accelerate: command not found
bash: accelerate: command not found
2340 3
|
Ubuntu 关系型数据库 MySQL
提示-bash: command not found的解决方法集锦
提示-bash: command not found的解决方法集锦