Source: http://ndl.ethernet.edu.et/bitstream/123456789/19632/1/bash Cookbook Solutions and Examples for bash Users, 2nd Edition.pdf