When one writes a shell script there are a variety of shebang lines that could be used:
- #!/usr/bin/env bash
or one of many other options.
Of these only the first two are possibly correct.
Using #!/bin/bash is wrong because:
- Sometimes bash isn't installed.
- If it is installed, it may not be in /bin
- If it is in /bin, the user may have decided to set PATH to use a different installation of bash. Using an absolute path like this overrides the user's choices.
- bash shouldn't be used for scripts intended for portability
If you have bash specific code use #!/usr/bin/env bash. If you want more portable code try using Debian's checkbashism to find instances of non-POSIX compliant shell scripting.