我试图echo
通过将内容写入文件来创建脚本,而不是使用编辑器打开它
echo -e "#!/bin/bash \n /usr/bin/command args" > .scripts/command
Run Code Online (Sandbox Code Playgroud)
的输出:
bash: !/bin/bash: 事件未找到
我已将这种奇怪的行为与bang隔离开来。
$ echo !
!
$ echo "!"
bash: !: event not found
$ echo \#!
#!
$ echo \#!/bin/bash
bash: !/bin/bash: event not found
Run Code Online (Sandbox Code Playgroud)