String manipulation using bash