You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Just a bit of forewarning with regard to the "recommended" use of shebangs.
# Right:
#!/usr/bin/env bash
# Less right:
#!/bin/bash
Using env by default is not a good habit because as you state above:
The former searches the user's PATH to find the bash binary.
You do not WANT bash looking at a users local path for say, system scripts, things meant to be run by root or any other user. To say the latter is bad, is.. well, bad itself.
PATH can be manipulated, a script can be set readonly.
Took an inordinate amount of time to explain this to a junior sysadmin who was adamant every script on a production host should be changed "because".
The text was updated successfully, but these errors were encountered:
Just a bit of forewarning with regard to the "recommended" use of shebangs.
Using env by default is not a good habit because as you state above:
The former searches the user's PATH to find the bash binary.
You do not WANT bash looking at a users local path for say, system scripts, things meant to be run by root or any other user. To say the latter is bad, is.. well, bad itself.
PATH can be manipulated, a script can be set readonly.
Took an inordinate amount of time to explain this to a junior sysadmin who was adamant every script on a production host should be changed "because".
The text was updated successfully, but these errors were encountered: