您的位置:首页 > 其它

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

2013-06-26 09:49 2366 查看
问题:运行shc的时候出现如下错误

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

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

$cat test1.sh
echo "hello"
cal


Code:

$ shc -f test1.sh
shc: 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)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐