http://mywiki.wooledge.org/BashFAQ/045