CIs*_*ies 7 command-line text-processing
我想在脚本的开头显示欢迎消息:
echo "Running $0 $@"
Run Code Online (Sandbox Code Playgroud)
但$@可能会很长。如何将此行分成多个最多 80 个字符的行?
Art*_*ild 16
使用fold。
echo "Running $0 $@" | fold -sw 80
Run Code Online (Sandbox Code Playgroud)
-s包裹在空格上。
-w 80将宽度设置为 80 列。