bug-coreutils
[Top][All Lists]
Advanced

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

Re: touching "-"


From: Eric Blake
Subject: Re: touching "-"
Date: Wed, 9 Dec 2009 19:51:47 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Paul Eggert <eggert <at> CS.UCLA.EDU> writes:

> > ls is not one of those commands.  So rather than listing
> > stdin or stdout (neither of which makes sense)
> 
> Actually, it would make a lot of sense for 'ls' to list stdin, no?
> 'ls' could apply fstat to stdin and show the results.

POSIX says:
"Where a utility described in the Shell and Utilities volume of POSIX.1-2008 as 
conforming to these guidelines is required to accept, or not to accept, the 
operand ’−’ to mean standard input or output, this usage is explained in the 
OPERANDS section. Otherwise, if such a utility uses operands to represent 
files, it is implementation-defined whether the operand ’−’ stands for standard 
input (or standard output), or for a file named −."

And OPERANDS for ls(1) doesn't mention behavior either way.  So I'm in favor of 
such a change.  But it takes some thought.  Would:

ls - < .

behave like 'ls .' or 'ls -d .'?

-- 
Eric Blake






reply via email to

[Prev in Thread] Current Thread [Next in Thread]