How can I read words (instead of lines) from a file?

前端 未结 7 1844
眼角桃花
眼角桃花 2020-12-16 12:37

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:



        
相关标签:
7条回答
  • 2020-12-16 13:16

    I came across this question and the proposed answers, but I don't see listed this simple possibile solution:

    for word in `cat inputfile`
    do
      echo $word
    done
    
    0 讨论(0)
提交回复
热议问题