pull substring from string in bash