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

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -