Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我用'>'输出一个文件,但我不喜欢它的形式;我想改变它的布局?例如: wrap 后面的特殊字符串
该文件如下所示:
#0 xxxxxxxxxxxxxx #1xxxxxxxxxxxxxxxxx #2xxxxxxxxxx
我希望它看起来像:
#0 xxxxxxxxxxxx #1 xxxxxxxxxxxx #2 xxxxxxxxxxx
您可以尝试在 # 字符之前添加换行符的这种逻辑。
echo "#0 xxxxxxxxxxxxxx #1xxxxxxxxxxxxxxxxx #2xxxxxxxxxx" | sed 's/\#/\n#/g'