Tag Archives: SHC report error

[Solved] shc -f xxx.sh shc: invalid first line in scrip

shc -f xxx.sh shc: invalid first line in scrip
Problem: The following error occurs when running shc
Code: $ shc -f test1.sh shc: invalid first line in script
Analysis: The script works fine
$cat test1.sh
echo “hello”
cal
Code:
$ shc -f test1.sh
shc: invalid first line in script: echo “hello”
shc: Success
Reason:

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:

Explanation:
Add to the first line of the script ( #! /bin/bash)
Pro-tested available!