Added an extract function which can be used in .bashrc
credits go to Mendel Cooper and his example in the Advanced Bash-Scripting Guide
http://tldp.org/LDP/abs/html/sample-bashrc.html