Re: Scripting question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
Psyche-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/psyche-list

[Index of Archives]     [Fedora General Discussion]     [Red Hat General Discussion]     [Centos]     [Kernel]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat 9]     [Gimp]     [Yosemite News]

  Powered by Linux