On 7/5/19 11:31 PM, Eric Blake wrote:

> If you wish to cat a file named '-' in the current directory, spell it
> './-' or use an absolute path to that file.  That's true of all command
> line utilities that treat '-' as stdin (not just cat).

For more fun, go figure out why:

grep - - --
grep [---]

behave the same, regardless of whether you have a file named '-' in your
current working directory (unless you use shopt -s failglob).  And the
rule on using ./- for a file in the current directory also applies to
touch, except there '-' means stdout instead of stdin.

Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to