You are on page 1of 1

# how to split a string in bash

x=a:b:c
first_word=${x%%:*}

http://ask.metafilter.com/80862/how-split-a-string-in-bash

You might also like