The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-07-2008
hemangjani hemangjani is offline
Registered User
  
 

Join Date: Feb 2006
Posts: 73
You could run the following command:

sed '/^$/d' < file1 > file2

file2 is the one without blank lines.

some of the version of sed allows '-i' switch to do in place. It saves the output in the same file.