1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-02-18 21:32:12 +02:00

(usage, tee): "tee -" writes to standard output, not

to a file named "-".
This commit is contained in:
Paul Eggert
2004-08-10 22:08:58 +00:00
parent 7b99d60f08
commit 8dafbe5806

View File

@@ -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]);