use sed to extract a substring using regular expressions - http://dallascao.com/en...