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!
Read More:
- linux use sh execute source error [How to Solve]
- [Solved] svn: OPTIONS of ‘https://xxx/svn/xxx’: SSL handshake failed: SSL error: Key usage violation in certificate has been detected.
- [Solved] RHEL 7 installs Oracle RAC 11.2.0.4, executes root.sh error ohasd: failed to start
- SSH Connect Service Error: Could not connect to ‘xxx.xxx.xx.xx‘ (port 22): Connection failed.
- ERROR: Invalid subnet : invalid CIDR address: [How to Fix]
- [Solved] error:getaddrinfo ENOTFOUND xxx.xxxx.com xxx.xxxx.com:443
- [Solved] Ubuntu Server 18.4 System /etc/sudoers: syntax error near line 32
- [Solved] bash: /etc/vimrc: line 15: syntax error near unexpected token `“autocmd“‘
- [Solved] check_urdf demo05_test.urdf Error: Error document empty. at line 71 in /build/urdfdom-YM
- [Solved] sbatch: error: Batch script contains DOS line breaks (\r\n)
- Solution to gzip: stdin: invalid compressed data — format violated error in decompressing. Tgz file under Linux
- [Solved] ubuntu Run jupyter Error: print(‘Error in generated code:‘, file=sys.stderr) SyntaxError: invalid syntax
- [Solved] Except CvBridgeError,e:SyntaxError:invalid syntax
- [Solved] error adding symbols: DSO missing from command line
- Nginx error: nginx: [error] invalid PID number ““ in “/run/nginx.pid“
- [Solved] Yum Install Software Error: Invalid configuration value: failovermethod=priority…
- [Solved] Samba Mount Error: mount error(22): Invalid argument
- [Solved] Internal error XFS_WANT_CORRUPTED_GOTO at line 1635 of file fs/xfs/libxfs/xfs_alloc.c.
- VMware: vmw_ ioctl_ Command error invalid parameter [How to Solve]
- [docker][issue]Error response from daemon: mkdir xxx: file exists: unknown