Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flash_all: #!/usr/bin/env bash is generally considered better for portability. #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

scientiac
Copy link

I am using NixOS where bash isn't on /bin/bash, hence the script didn't run. So,

#!/usr/bin/env bash:

  • This uses the env command to find the Bash interpreter in the user's PATH. It searches for bash in the directories listed in the PATH environment variable and uses the first one it finds.
  • This method is more portable because it does not assume a specific location for the Bash interpreter. It will work as long as Bash is installed and available in the user's PATH.

…tability. It allows the script to run on different systems where Bash might be installed in different locations
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