0

I run the following line on linux/solaris machine ( all output will write in to /tmp/Log from application.bin )

 ./application.bin 1>>/tmp/Log

We can see the content of the /tmp/Log file

 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 

My question:

what I need to change or add in the syntax:

   "1>>/tmp/Log" ? 

in order to add space between each line as the following example

       /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 

Remark – the option to add space between each line after /tmp/Log was created isn’t relevant

3
./application.bin | sed '$!G' >> /tmp/Log
  • $ meaning "only on the last line"; ! negate the line selector, i.e. on every line except the last one; G append a new-line to pattern (the line) and the "hold space" (empty by default) - equivalent of s/$/\n/ – peterph Dec 7 '12 at 0:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.