As a general rule, using
env is more portable. It is unlikely but theoretically conceivable to find a system that has no
/bin/bash. It is also possible that the user running the script has their own bash version that is somehow different.
env means that the first
bash instance in the user's path will be chosen. This means that
#!/usr/bin/env bash will always work with the user's chosen bash version and it should always evaluate to an available
bash even in non-standard systems. This becomes much more important if you are using another interpreter, not bash. Perl for example, can be installed to different locations on different systems but
env will find it regardless.
#!/usr/bin/env PROGRAM is a good habit to get into since it makes your scripts more portable to different *nix versions.