Source: https://warwick.ac.uk/fac/sci/mathsys/courses/msc/computation/bash-1.pdf