dylanaraps / pure-bash-bible

📖 A collection of pure bash alternatives to external processes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Misleading use of shebang

h1z1 opened this issue · comments

commented

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".

commented

See: #82