I noticed a number of these scripts are marked as #!/bin/sh, but still have some bashisms. I was running some on my system where I have sh linked to dash and had errors due to this (it would be the same on Ubuntu/Debian, where dash is default, I believe). I'd recommend running shellcheck on them all to be careful.
In general:
- echo flags are not posix compliant, so it's best to use
printf "%s" "$var" rather than echo -n "$var".
== is a bashism too, but it looks like a simple = would suffice in most places in these scripts.
[[ ]] are undefined in posix as well.
Again, shellcheck is the easiest way to know what's what. Otherwise, it's better to mark them as bash scripts.
I noticed a number of these scripts are marked as
#!/bin/sh, but still have some bashisms. I was running some on my system where I haveshlinked todashand had errors due to this (it would be the same on Ubuntu/Debian, where dash is default, I believe). I'd recommend runningshellcheckon them all to be careful.In general:
printf "%s" "$var"rather thanecho -n "$var".==is a bashism too, but it looks like a simple=would suffice in most places in these scripts.[[ ]]are undefined in posix as well.Again, shellcheck is the easiest way to know what's what. Otherwise, it's better to mark them as bash scripts.