open-eid / linux-installer

Ubuntu meta package
55 stars 21 forks source link

Installer shebang should refer to /bin/sh if it's meant to be a POSIX compatible script #89

Closed moll closed 2 years ago

moll commented 3 years ago

Hey,

I noticed the shebang in https://github.com/open-eid/linux-installer/blob/master/install-open-eid.sh refers to #!/bin/bash, yet the official guide video on https://www.id.ee/artikkel/paigalda-id-tarkvara/ (https://www.youtube.com/watch?v=2zQshBBVtcc) instructs calling sh, which since 2006(?) has been Dash on Ubuntu (https://wiki.ubuntu.com/DashAsBinSh). The script works fine with Dash and probably other POSIX-compatible shells and should probably refer to /bin/sh directly, making sure shellcheck and other linters can catch any future bashisms.

Regarding this, I think the -e argument to echo could/should also be removed and/or replaced to use printf. I'm not sure about echo arguments' POSIX-compatiblity, but a fresh install on Ubuntu 20.04 today sure prints -e out, as can be confirmed:

$ sh -c 'echo -e test'
-e test

Cheers