Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grep out (grep -v) all lines that are empty in a file ?

Status
Not open for further replies.

MoshiachNow

IS-IT--Management
Joined
Feb 6, 2002
Messages
1,851
Location
IL
How would I grep out (grep -v) all lines that are empty in a file ?

"Long live king Moshiach !"
 
Hi,

Try :

sed -e '/^$/d' input_file

Jean Pierre.
 
How about grep -v &quot;^$&quot; < yourfile

Dickie Bird ((:-)))
 
Thanks,Dickie Bird

I have tried it before in tcsh,it would not work.
It does in ksh.

&quot;Long live king Moshiach !&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top