[[email protected] ~]# printf "#!/bin/sh\nsomething"
-bash: !/bin/sh\nsomething": event not found
无法将命令作为命令执行,因为它不会保存到命令历史记录中。从shell或shellcript写入shell脚本?
我必须稍微混淆hashbang才能让我过去吗?
我尝试这样做:
[[email protected] ~]# printf "%s!/bin/sh\nsomething" #
-bash: !/bin/sh\nsomething": event not found
(也试过echo
达到同样的效果)
哦废话。是否真的是导致问题的历史替代?那么,换行似乎用单引号,所以看起来不错。 –