我想把一行分成几个词。我知道这可以用这个来完成
For word in $line; do echo $word; done
Run Code Online (Sandbox Code Playgroud)
但我想制作一组 3-3 个单词。所以我的问题是,如何将一行分成 3-3 个单词的组?
例如
Input : I am writing this line for testing the code.
Output :
I am writing
this line for
testing the code.
Run Code Online (Sandbox Code Playgroud) bash ×1