例如,我只想在命令行中打印类似的内容。假设我有一个名为 file.txt 的文件。
What is life?
how are you?
hi
whatup
this is more than
Run Code Online (Sandbox Code Playgroud)
我想使用 awk 在命令行上打印出来,但如果字符数大于 7,那么输出应该是这样的。
What is
life?
how are
you?
hi
whatup
this is
more than
Run Code Online (Sandbox Code Playgroud)
所以基本上当我使用 awk 时,如果字符数大于 7,它会将输出中的行分成两行。