begin  quoting Brad Beyenhof as of Sat, Feb 23, 2008 at 07:07:44AM -0800:
> On Sat, Feb 23, 2008 at 12:37 AM, SJS <[EMAIL PROTECTED]> wrote:
> >  Then we sort again, which collects all of the blank lines together. The
> >  -u option to sort does basically the same thing as uniq -- identical
> >  lines are collapsed into just one.  Since the only lines that are going
> >  to be identical are the blank lines, this has the effect of getting
> >  rid of the blank lines.
> 
> That (sort -u) doesn't really get rid of the blank lines; you still
> end up with a single blank line in the output.

Yes. It gets rid of the blank lines, and leaves just one.

>                                                I prefer to do such a
> step with "grep ." to return all lines that contain non-whitespace
> characters.

Well, . matches spaces and tabs, so to be pedantic, that's not entirely
true. :)

But there's nothing between ^ and $ to catch the . so it works just
fine.  Better would be to use a g/re/d with an re of "^$". . .

-- 
Optimal was not the point
Quick and good enough was.
Stewart Stremler

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to