diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2004-08-10 22:08:58 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2004-08-10 22:08:58 +0000 |
commit | 8dafbe5806de7a2faf01ebc863e30aa134350da0 (patch) | |
tree | 0969e16da135984302381112b3b8de17d25b200e /src | |
parent | 7b99d60f0873544dc3591146d0162b00db893080 (diff) | |
download | coreutils-8dafbe5806de7a2faf01ebc863e30aa134350da0.tar.xz |
(usage, tee): "tee -" writes to standard output, not
to a file named "-".
Diffstat (limited to 'src')
-rw-r--r-- | src/tee.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -68,6 +68,10 @@ Copy standard input to each FILE, and also to standard output.\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); + fputs (_("\ +\n\ +If a FILE is -, copy again to standard output.\n\ +"), stdout); printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); } exit (status); @@ -158,7 +162,9 @@ tee (int nfiles, const char **files) for (i = 1; i <= nfiles; i++) { - descriptors[i] = fopen (files[i], mode_string); + descriptors[i] = (STREQ (files[i], "-") + ? stdout + : fopen (files[i], mode_string)); if (descriptors[i] == NULL) { error (0, errno, "%s", files[i]); |