26 May 26
23 Mar 26
11 Mar 26
A tool for glamorous shell scripts π
A tool for glamorous shell scripts π
27 Jul 25
Iβve implemented custom trap codebfor error display but it doesnβt work reliablu, this should help.
27 Oct 22
#!/usr/bin/env bash
set -o errexit set -o nounset set -o pipefail if [[ β${TRACE-0}β == β1β ]]; then
set -o xtrace
fi
if [[ β${1-}β =~ ^-*h(elp)?$ ]]; then
echo 'Usage: ./script.sh arg-one arg-two
This is an awesome bash script to make your life better.
β
exit
fi
cd β$(dirname β$0β)β
main() {
echo do awesome stuff
}
main β$@β
This article is about a few quick thumb rules I use when writing shell scripts that Iβve come to appreciate over the years. Very opinionated.