If I have a string variable who's value is "john is 17 years old" how do I tokenize this using spaces as the delimeter? Would I use awk?
"john is 17 years old"
awk
$ string="john is 17 years old" $ tokens=( $string ) $ echo ${tokens[*]}
For other delimiters, like ';'
$ string="john;is;17;years;old" $ IFS=';' tokens=( $string ) $ echo ${tokens[*]}
1.4m articles
1.4m replys
5 comments
57.0k users