Understanding the bin, sbin, usr/bin, usr/sbin split (2010)
And this has led to de facto standards, like '#!/bin/sh' is a 'standard' shell shebang, but not POSIX; if you want your script to be portable, you have to use '#!/usr/bin/env sh'. <i>env</i> is forever in '/usr/bin' probably because it first came about after new tools started moving to '/usr'. And I don't think <i>env</i>'s file path is even in POSIX, it's just a de facto standard.<p>Another fun fact is that <i>execve()</i> (which executes shebangs) only allows a single argument to the shebang program. Meaning if you use '#!/usr/bin/env sh', you can't specify arguments to 'sh' in the shebang. In any case, the name of the file being executed is appended as an additional argument at the end of the shebang.