bash
is "sh-compatible" some features of bash
will break or cause unexpected behaviour in sh
..sh
extension.bash
script, not an sh
scriptgrep
multiple times only the last grep
in the sequence can be called with -q
.#!
must be at the very start of the file, with no spaces or blank lines before it.#!/usr/bin/env
searches PATH
for bash
, and bash
is not always in /bin
, particularly on non-Linux systems."bash
and tell it to read the script myscript
. When executing the script this way the shebang line (#!
) is just a comment, bash
does nothing with itbash
manually, we can execute myscript
directly.myscript
is executed this way, the shebang line (#!
) is used to determine which interpreter to use.