[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Intent to Rewrite: pwgen



On Thu, May 31, 2001 at 06:26:39PM -0400, tytso@thunk.org wrote:
> On Thu, May 31, 2001 at 09:23:06PM +0000, Lars Wirzenius wrote:
> > This is quite non-intuitive, complicated and strange behavior, please
> > don't do it.  If nothing else, it makes it harder to debug things by
> > testing them out on the command line. (Not that I can see how isatty(0)
> > can be used to test interactive use.)
> 
> It's not that strange; /bin/ls does it.  If /bin/ls notices that
> stdout (sorry, I should have said isatty(1)) is a tty, then the -C
> option is implied; otherwise the -1 option is implied.
> 
> So there's ample precedent for doing this, and I've never heard
> screams of script writers who use /bin/ls in their shell scripts.  :-)

To quote RMS:

    The GNU coding standards say programs should not alter their output
    according to where the output is going.  This leads to unreliability
    and unpredictability.  (It causes inconvenience in ls, also, but I
    decided that compatibility with POSIX outweighs that inconvenience.)

I must say that I agree with him on this one. Having different output
based on what sort of file stdout is being written to can be very
confusing ...

Timshel

-- 
   Timshel Knoll <timshel@pobox.com>  for Debian email: <timshel@debian.org>
                Geomatics/Computer Science double degree, RMIT
      Debian GNU/Linux developer, see http://people.debian.org/~timshel/
                For GnuPG public key: finger timshel@debian.org



Reply to: