[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Leading spaces from wc --lines
From: |
Bob Proulx |
Subject: |
Re: Leading spaces from wc --lines |
Date: |
Sun, 9 Jan 2005 09:33:34 -0700 |
User-agent: |
Mutt/1.5.6+20040907i |
Paul Eggert wrote:
> Paul Jarc writes:
> > "Bryce Nesbitt (mailing list account)" <address@hidden> wrote:
> > > The "wc" command always seems to place leading spaces on all results,
> > It doesn't for me, with 5.2.1. Upgrade?
>
> Yes, the behavior changed in 5.1.0.
> ...
> coreutils 5.1.0 or later you can rely on "wc -l" to omit leading
> spaces when it is given zero operands or one operand.
And there was much rejoicing. However...
> POSIX allows leading spaces, though, so you can't rely on this
> behavior in portable code.
Unfortunately there will be a lot of pre-5.2.0 wc commands out there
for a long time. Also SysV-like systems such as HP-UX never emited
spaces. But IBM AIX does emit spaces. Oh the humanity of it all! So
regardless of coreutils behavior portable scripts should code for wc
emitting spaces.
Bob