A function similar to Perl’s die() in bash
This is maybe a bit silly, but Perl has a die() function that is really handy for quitting a script with an error message. And I kind of miss it in Bash. So it can be defined with this simple one-liner:
function die { echo $1 ; exit 1 ; }
And then it can be used with something like:
unzip thefile.zip || die "Unzip returned with error status"
The Perl feeling, in Bash.