> Jan Stary <[email protected]> writes:
> 
> > The diff below makes head(1) recognize `-'
> > as a name for the standard input,
> > as many other utilities do.
> 
> Makes sense to me.  The following points could be improved IMO:
> - using strcmp sounds cleaner than those char comparisons
> - I don't think the man page bits are needed.  Utilities that read from
>   stdin are supposed to support `-'.  I'm not sure whether the extra
>   example is really helpful.
> - should we avoid closing stdin (multiple times)?  Even though our
>   fclose(3) seems to cope with this, it seems that neither the
>   C standard nor POSIX offer such a guarantee.

Do standards permit that extension?

This is command used in scripts.  Scripts are often portable.  If one
operating system has an extension, but others don't, then those
scripts become unportable to use use of these extensions.

I'm not raising a new argument here, it's been raised numerous times
when it comes to commands commonly used in scripts.

So consider that first.

Reply via email to