Skip to content

Conversation

Sighery
Copy link

@Sighery Sighery commented Jul 13, 2023

Some systems might not have the /bin/bash link, they might just have a /bin/sh that detects whether to run sh or bash automatically. One example of this is NixOS, or the BSDs.

Instead you can rely on the env utility to figure out where bash is, using the user's PATH. env will look into all the available paths and use the first path that matches the binary you're looking for, which should make this script more portable.

Some systems might not have the `/bin/bash` link, they might just have
a `/bin/sh` that detects whether to run `sh` or `bash` automatically.
One example of this is NixOS, or the BSDs.

Instead you can rely on the `env` utility to figure out where `bash`
is, using the user's `PATH`. `env` will look into all the available
paths and use the first path that matches the binary you're looking
for, which should make this script more portable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant