Skip to content

Instantly share code, notes, and snippets.

@rmoyano
Created February 24, 2025 16:58
Show Gist options
  • Save rmoyano/1a52ec2c7f5663df1cbea9df70abedd4 to your computer and use it in GitHub Desktop.
Save rmoyano/1a52ec2c7f5663df1cbea9df70abedd4 to your computer and use it in GitHub Desktop.
Shell scripting

Difference between "#!/usr/bin/env bash" and "#!/usr/bin/bash": Official Slackware book created by David Cantrell, Logan Johnson & Chris Lumens. Version 2.0 is a draft that is in development.

Because /usr/bin/env can interpret your $PATH, which makes scripts more portable.
#!/usr/bin/env bash #lends you some flexibility on different systems
Running a command through /usr/bin/env has the benefit of looking for whatever the default version of the program is in your current environment.

Will only run your script if python is installed in /usr/local/bin.
#!/usr/bin/bash #gives you explicit control on a given system of what executable is called

$ apt-get install ca-certificates curl -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment