Re: less-wide df(1) output
"John F. Woods" <[email protected]>
| Newsgroups | gmane.os.netbsd.devel.general |
|---|---|
| Message-ID | <[email protected]> |
> > > 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. An implementation which adjusts the spacing to present deliberately disorderly columns is probably wrong, however. > 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. A quick pass through "sed -e 's/ */ /g'" will make standard-conformant output with alignment spaces quite easy to parse with cut(1). In fact, since the statement refers to "spacing" and not "spaces", "sed -e 's/[ \t][ \t]*/ /g'" is probably a more appropriate choice.