-2
我是Linux中的新手。 我可以在终端上直接运行这个命令:(已保存)bash shell脚本参数“”
7za t -p' \' -w -y /root/test2.7z | grep -i OK
我尝试了7zip的文件密码测试脚本(名为test_script.sh):
7za t -p$1 -w -y /root/test2.7z | grep -i OK
,但不能得到这个脚本的结果是:
sh /root/test_script.sh ' \'
运行结果:
[[email protected] ~]# sh /root/test_script.sh ' \'
7za t -p \ -w -y /root/test2.7z | grep -i OK
ERROR: No more files
\
System ERROR:
Unknown error 18446744071562526744
[[email protected] ~]# sh /root/test_script.sh " \"
>
>
>
终端挂起,也许等待下一个命令。
请帮助我如何传递参数“\”。
'-p “$ 1”'。当然你在研究中遇到了这个建议。 – rici
另外,http://shellcheck.net是你的朋友,用于检测这些错误... – anishsane