Skip to content

Commit

Permalink
Merge pull request #254 from mknos/tee-nflag
Browse files Browse the repository at this point in the history
tee: expectation for -n option
  • Loading branch information
briandfoy authored Sep 19, 2023
2 parents 6bb289f + 9fed043 commit 85736a1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bin/tee
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ if ($ignore_ints) {
$SIG{'PIPE'} = 'PLUMBER';
$mode = $append ? '>>' : '>';
$fh = 'FH000';
unless ($nostdout) {
if ($nostdout) {
unless (@ARGV) {
warn "$0: file argument must be given with -n\n";
exit 1;
}
} else {
%fh = ('STDOUT', 'standard output'); # always go to stdout
}
$| = 1 if $unbuffer;
Expand Down

0 comments on commit 85736a1

Please sign in to comment.