我在 linux/solaris 机器上运行以下行(所有输出都将从 application.bin 写入 /tmp/Log )
./application.bin 1>>/tmp/Log
我们可以看到/tmp/Log文件的内容
more /tmp/Log
/etc/opt/OA/share/conf/OpC/mgmt_sv/ui/registration/C/opc_op /etc/opt/OA/share/conf/analysis/system_odbc.iniaaaa
/etc/opt/OA/share/conf/ovspmd.authaaaa
/etc/opt/OA/share/conf/ovwdb.authaaaa
/etc/opt/OA/share/conf/ovw.authaaaa
我的问题:
我需要在语法中更改或添加什么:
"1>>/tmp/Log" ?
为了在每行之间添加空格,如下例所示
/etc/opt/OA/share/conf/OpC/mgmt_sv/ui/registration/C/opc_op
.
/etc/opt/OA/share/conf/analysis/system_odbc.iniaaaa
.
/etc/opt/OA/share/conf/ovspmd.authaaaa
.
/etc/opt/OA/share/conf/ovwdb.authaaaa
.
/etc/opt/OA/share/conf/ovw.authaaaa
备注 – 创建 /tmp/Log 后在每行之间添加空格的选项不相关
答案1
./application.bin | sed '$!G' >> /tmp/Log