Subject: Re: less-wide df(1) output
To: NetBSD Miscellaneous Technical Discussion List <tech-misc@netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: tech-misc
Date: 10/07/2002 02:11:25
[ On Sunday, October 6, 2002 at 20:40:34 (-0400), John F. Woods wrote: ]
> Subject: Re: less-wide df(1) output 
>
> > > >  The implementation may adjust the spacing of the header line and
> > > >  the individual data lines so that the information is presented in
> > > >  orderly columns.
> 
> > Such column alignment is only and option in the specification and though
> > with the above qualification it won't make the implemenation
> 
> > non-conformant, it does strictly cause unnecessary differences with the
> > strict interpretation of the specification,
> 
> The strict interpretation of the clip from the standard above is that
> the implementation may adjust the spacing of the header line and the 
> individual data lines so that the information is presented in orderly columns.

Yes, that's what I agreed with.  It's an allowable option.  The key word
is "may".

> An implementation which adjusts the spacing to present deliberately disorderly
> columns is probably wrong, however.

I'm not sure what you mean by that, other than maybe: "if you don't do
it right then you'd best not do it at all."

> > and it will cause unnecessary problems with other POSIX tools that only
> > work with one field separator character and thus nullifies one of the
> > main reasons for wanting "portable" output
> 
> A "portable" script which assumes that only one space separates the fields
> is wrong, given the statement from the standard above.

I'm sure we all realize that, but examples of this kind of bug are not
hard to find.  I can remember fixing many myself, some in my own code!  :-)

-- 
								Greg A. Woods

+1 416 218-0098;            <g.a.woods@ieee.org>;           <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>