Re: Scripting question

Alan Peery <[email protected]>
Newsgroups gmane.linux.redhat.release.psyche
Message-ID <[email protected]>
Leonard Miller wrote:

>I have another file with blank lines - no space or tabs, just
>carriage returns. 
>Can I use that same line to remove those blank lines?
>  
>
Use

cat file | grep -v  ^\$

This will keep only those lines NOT matching "^\$", a line where there 
is nothing between the logical beginning and end of the line.  If you 
want to find lines that only have the letter q on them,

cat fred | grep ^q\$

would do the trick.

Alan


-- 
Psyche-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/psyche-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.