Split string by newline and space in Bourne shell

Posted by l0b0 on Stack Overflow See other posts from Stack Overflow or by l0b0
Published on 2010-05-27T15:55:55Z Indexed on 2010/05/27 16:01 UTC
Read the original article Hit count: 365

Filed under:
|

I'm currently using the following to split a file into words - Is there some quicker way?

while read -r line
do
    for word in $line
    do
        words="${words}\n${word}"
    done
done

© Stack Overflow or respective owner

Related posts about shell

Related posts about bourne-shell