Re: Scripting: exclude null lines

From: Klaus Oberle (Klaus.Oberle@LINDE-MH.DE)
Date: Fri Jul 18 2003 - 06:51:54 EDT


Simon,

try this:

grep -v "^$" <your file>

/klaus

---------------------------------------------------
Klaus Oberle
IT Administration
Linde Material Handling
klaus.oberle@linde-mh.de
www.linde.com
---------------------------------------------------

                      "Green, Simon"
                      <Simon.Green@EU.A An: aix-l@Princeton.EDU
                      LTRIA.COM> Kopie:
                      Gesendet von: IBM Thema: Scripting: exclude null lines
                      AIX Discussion
                      List
                      <aix-l@Princeton.
                      EDU>

                      18.07.2003 12:30
                      Bitte antworten
                      an IBM AIX
                      Discussion List

I have a file containing data lines interspersed with null lines. (These
lines do NOT contain spaces: it's just a new-line character.)

Is there a simple way of excluding those null lines in a Korn-shell script?
I'm sure there ought to be but nothing I've tried has worked, so far.

Simon Green
Altria ITSC Europe Ltd

AIX-L Archive at http://marc.theaimsgroup.com/?l=aix-l&r=1&w=2
AIX FAQ at http://www.faqs.org/faqs/aix-faq/

N.B. Unsolicited email from vendors will not be appreciated.

This e-mail may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this e-mail
in error) please notify the sender immediately and destroy this e-mail.
Any unauthorised copying, disclosure or distribution of the material
in this e-mail is strictly forbidden.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Linde Material Handling.

Since January 2002 we use the e-mail domain linde-mh.de instead
of linde-fh.de.

This mail has been swept for the presence of computerviruses.



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:02 EDT