bug-coreutils
[Top][All Lists]
Advanced

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

Re: "touch -" touching standard output


From: Paul Eggert
Subject: Re: "touch -" touching standard output
Date: Mon, 26 Sep 2005 23:36:19 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

address@hidden (Bob Proulx) writes:

> Making special cases such as "-" mean stdin or stdout always seemed
> like an ugly hack to me.  It makes it more difficult to actually refer
> to real files named "-".

True, though that horse left the barn around 1975 and hasn't been seen since.

Here's a fun example.  The following shell command works even with
older coreutils (e.g., Debian stable), and it updates /var/tmp's time
stamp on my host:

  touch /dev/stdout 1< /var/tmp

It's not clear what effect this command will have on various other
hosts, though.

The idea of --fd=0 --fd=1 would also work, but would be harder to
parse and explain -- e.g., people might want to interleave those
options with file names, which runs into getopt and documentation
issues.




reply via email to

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