#!/usr/bin/env is portable to almost every system that understands
#!. It's a useful idiom for invoking a program that could be anywhere in
$PATH. If you hard-code the path to the interpreter, your script might not work if you copy it to a different machine.
My general policy is to use
#!/bin/sh for scripts that only use portable
sh features (i.e., only POSIX features if I only care about modern unices, and only Bourne features if I care about older systems such as older Solaris releases) and
A downside of
#!/usr/bin/env is that it doesn't let you pass any option to the interpreter. With some interpreters, this can be worked around by specifying the options as directives instead, or by making the second line be a dual-language snippet that invokes the interpreter when executed by sh and does nothing when executed by the target interpreter. There's a common perl idiom, for instance (useful to pass