k0lter / autopostgresqlbackup

Automated tool to make periodic backups of PostgreSQL databases
52 stars 17 forks source link

Use the more portable shebang `/usr/bin/env bash` #24

Closed dennisse closed 1 year ago

dennisse commented 1 year ago

Not all distros have bash in /bin/bash. In fact, most distros are moving binaries away from /bin and into /usr/bin (even Debian!). But still, not all distros have bash in /bin or /usr/bin. However, pretty much all of them have env in /usr/bin. /usr/bin/env bash searches $PATH for the bash executable, and is the most portable shebang to use.

I.e., on OpenBSD, you find bash in /usr/bin/local/bash, and there is no /bin/bash, so autopostgresql fails before it even starts.

/usr/bin/env bash seems to be best practice :).