linux - how to replce empty lines with text using sed -


How can the blank rows change with text using SAL? I tried some tricks of the previous post but it does not work, can some body help me with this?

Example file content -

  Linux is an OS. Linux's opensource has different flavors like Firdado, Census etc. in Linux.  

I want to change these blank lines with text like Hello.

Just match the start-line, if you just want the empty lines, then just the interval < / P>

  sed -e's / ^ $ / hello / g ' 

If you also want to match lines with spaces,

    > 
  sed -e 's / ^ \ s * $ / hello / g'  

Comments

Popular posts from this blog

c++ - C/pp Sockets, recv()/send() works only under gdb -

GO: Serve static pages -

objective c - How to open front/back camera at the same time in iOS developing? -