Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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


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

share|improve this question
up vote 3 down vote accepted
./application.bin | sed '$!G' >> /tmp/Log
share|improve this answer
$ 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 posting your answer, you agree to the privacy policy and terms of service.

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