transmission
transmission copied to clipboard
The script is a bash script and not an sh script
The shebang line claims that the script can be executed with /bin/sh
, which is usually a POSIX compliant shell. But the script uses features that are bash features and not covered by POSIX. Most prominently it makes heavy use of echo -e
which is not part of POSIX but supported by bash and some other shells. I suggest to either:
- change the shebang line to explicitly declare that this script requires bash as the interpreter, or to
- remove the bashism from the script to make it POSIX compliant
In Debian and derivatives like Ubuntu you can use the script checkbashisms
to get a list of bash-only features that your script is using. Besides echo -e
you also make use of ${PARAMETER//[0-9]}
.
@Alkaris That's what "remove the bashism from the script" means, yes. But that's not enough. There are other things like ${PARAMETER//[0-9]}
that would have to be replaced by something else.
Good noted! My rookie bad. I have used it on an OpenWRT router. For now, I will change the shebang line. Ideally, it would be fully POSIX. Sorry for the delay.