shc -f xxx.sh shc: invalid first line in scrip
问题:运行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)
亲测可用!
本文介绍了解决使用shc工具时遇到的“无效首行”错误的方法。要解决此问题,需确保脚本的第一行包含正确的shebang(例如 #!/bin/bash),以便shc能识别所使用的shell类型。
613

被折叠的 条评论
为什么被折叠?



