bash

Bash, the Bourne Again Shell, is one of the most ubiquitous shells on nix systems, being either the default or included in distributions.

Snippets

To run a command in an infinite loop, do something like this: while true; do echo hi mom; sleep 1; done

To redirect stdin and stdout from a command: foo > /dev/null 2> err.txt

To pass along your arguments when creating a wrapper: wrapped-script "$@"

To do a basic if-then/else check on a file exist:

if ! test -d /path/to/file ; then
  echo it does not exist;
else
  echo exists;
fi

Home