Bug in wc.

Mike Frysinger vapier at gentoo.org
Tue Mar 9 06:01:03 UTC 2010


On Monday 08 March 2010 22:19:38 Denys Vlasenko wrote:
> On Tuesday 09 March 2010 03:50, Mike Frysinger wrote:
> > On Monday 08 March 2010 20:56:07 Denys Vlasenko wrote:
> > > On Tuesday 09 March 2010 01:55, Harald Becker wrote:
> > > > Hallo Rob!
> > > > 
> > > > > Why do we have unnecessary leading whitespace?  What happend to
> > > > > small and simple and doing no more than absolutely necessary?
> > > > 
> > > > As far as I remember the original (K&R) behavior of wc was always to
> > > > produce leading whitespace (fixed format output). Only the newer
> > > > versions of gnu wc striped of this leading whitespace. That lead to
> > > > several shell script failures that had to be fixed during the last
> > > > years.
> > > 
> > > ... and now we have script failures because _new_ scripts expect _new_
> > > output format  >>:(  "Progress" sometimes looks like pointless churn.
> > 
> > it depends on the options i think.  normal `wc` still outputs leading
> > spaces, but `wc -c` never does.  coreutils-5.94 and coreutils-8.4 behave
> > the same ...
> 
> I distinctly remember old times when even 'wc -c <file' was spewing out
> leading spaces. Gosh... I am old enough now to talk about "old times" :)

sorry, didnt mean to imply "never does" as "never has".  5.94 is the latest 
version i had sitting around already compiled ... i certainly believe you when 
you say older versions had leading whitespace.  i recall `wc -l <file>` 
changing behavior at some point to not including leading whitespace if there's 
only one file as i had to often script around it in previous versions.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20100309/02113f3c/attachment.pgp>


More information about the busybox mailing list