I\'ve read this question about how to read n characters from a text file using bash. I would like to know how to read a word at a time from a file that looks like:
The read command by default reads whole lines. So the solution is probably to read the whole line and then split it on whitespace with e.g. for:
read
for
#!/bin/sh while read line; do for word in $line; do echo "word = '$word'" done done <"myfile.txt"