Re: way to cat a file with all lines except commented ones

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: plug
Date:  
To: plug-discuss
Subject: Re: way to cat a file with all lines except commented ones
grep "^#" -v file_name

That will return all lines that do not BEGIN with a pound sign "#".
This could be useful if you have added comments AFTER a command, but you
still want to see the line in your output.
example:
machine:~ # cat testfile
# commented line
line of stuff
more stuff # plus a comment
machine:~ # grep "^#" -v testfile
line of stuff
more stuff # plus a comment
machine:~ #

>>> 05/19/04 2:37 PM >>>

How can I cat a file and recieve all lines excpet ones commented out?


Jim
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss