[解决方法]shc -f xxx.sh shc: invalid first line in script

来源:互联网 发布:笨办法学python kindle 编辑:程序博客网 时间:2024/05/21 22:28

问题:运行shc的时候出现如下错误

Code: $ shc -f test1.sh shcinvalid first line in script

分析下:脚本可以正常运行

$cat test1.shecho "hello"cal
Code:
$ shc -f test1.shshc: invalid first line in script: echo "hello"shc: Success
原因:
You have to put the sha-bang (e.g. #!/bin/bash) at the beginning of the script, since shc need to know which shell is using. Here is an excerpt from the manual page:
解释:
在脚本的第一行添加上沙邦(#!/bin/bash
原创粉丝点击