Re: Scripting question

Mark Neidorff <[email protected]>
Newsgroups gmane.linux.redhat.release.psyche
Message-ID <[email protected]>
On Fri, 11 Jul 2003, Leonard Miller wrote:

> Thanks Alan,
> That worked great.  Now let me ask you this.
> 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?
> 
> Leonard
> 

No, becuase ther is no space to look for.  How about the tr command? When 
you have an empty line, you really have 2 new-line characters in a row, so 
you could execute a command like this:


$tr -s '\n\n'  < file > file_with_no_blank_lines

check the tr man page.  The man page didn't mention that the single quotes 
are needed, but they are.

Mark


-- 
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.