How to split one string into multiple strings separated by at least one space in bash shell?

前端 未结 8 1324
日久生厌
日久生厌 2020-11-27 09:17

I have a string containing many words with at least one space between each two. How can I split the string into individual words so I can loop through them?

The stri

8条回答
  •  无人及你
    2020-11-27 09:54

    echo $WORDS | xargs -n1 echo
    

    This outputs every word, you can process that list as you see fit afterwards.

提交回复
热议问题