From: Paul Eggert Date: Tue, 10 Aug 2004 22:08:58 +0000 (+0000) Subject: (usage, tee): "tee -" writes to standard output, not X-Git-Tag: COREUTILS-5_3_0~805 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8dafbe5806de7a2faf01ebc863e30aa134350da0;p=platform%2Fupstream%2Fcoreutils.git (usage, tee): "tee -" writes to standard output, not to a file named "-". --- diff --git a/src/tee.c b/src/tee.c index 71c1c13..ccd74da 100644 --- a/src/tee.c +++ b/src/tee.c @@ -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]);