<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/src/tee.c, branch v8.26</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v8.26</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v8.26'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2016-10-16T11:23:55Z</updated>
<entry>
<title>all: use die() rather than error(EXIT_FAILURE)</title>
<updated>2016-10-16T11:23:55Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2016-10-15T22:10:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=492dcb2eb191b844a2fd5e51db3eed85289bea1f'/>
<id>urn:sha1:492dcb2eb191b844a2fd5e51db3eed85289bea1f</id>
<content type='text'>
die() has the advantage of being apparent to the compiler
that it doesn't return, which will avoid warnings in some cases,
and possibly generate better code.
* cfg.mk (sc_die_EXIT_FAILURE): A new syntax check rule to
catch any new uses of error (CONSTANT, ...);
</content>
</entry>
<entry>
<title>maint: update all copyright year number ranges</title>
<updated>2016-01-01T14:10:41Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2016-01-01T14:10:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=b16e999f553b682e74e0a56750f649da05130c4f'/>
<id>urn:sha1:b16e999f553b682e74e0a56750f649da05130c4f</id>
<content type='text'>
Run "make update-copyright" and then...

* gnulib: Update to latest with copyright year adjusted.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
* tests/sample-test: Adjust to use the single most recent year.
</content>
</entry>
<entry>
<title>all: avoid quoting file names when possible</title>
<updated>2015-11-04T23:30:14Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2015-11-01T18:53:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=08e8fd7e38f2dae7c69c54eb22d508b6517e66e5'/>
<id>urn:sha1:08e8fd7e38f2dae7c69c54eb22d508b6517e66e5</id>
<content type='text'>
Quote file names using the "shell-escape" or "shell-escape-always"
methods, which quote as appropriate for most shells,
and better support copy and paste of presented names.
The "always" variant is used when the file name is
embedded in an error message with surrounding spaces.

* cfg.mk (sc_error_shell_quotes): A new syntax check rule
to suggest quotef() where appropriate.
(sc_error_shell_always_quotes): Likewise for quoteaf().
* src/system.h (quotef): A new define to apply shell quoting
when needed.  I.E. when shell character or ':' is present.
(quoteaf): Likewise, but always quote.
* src/*.c: Use quotef() and quoteaf() rather than quote()
where appropriate.
* tests/: Adjust accordingly.
</content>
</entry>
<entry>
<title>all: quote string arguments in error messages</title>
<updated>2015-10-27T17:24:54Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2015-10-27T13:13:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=6796698c9945d87236ffcc939137d0919ef04931'/>
<id>urn:sha1:6796698c9945d87236ffcc939137d0919ef04931</id>
<content type='text'>
These strings are often file names or other user specified
parameters, which can give confusing errors in
the presence of unexpected characters for example.

* cfg.mk (sc_error_quotes): A new syntax check rule.
* src/*.c: Wrap error() string arguments with quote().
* tests/: Adjust accordingly.
* NEWS: Mention the improvement.
</content>
</entry>
<entry>
<title>tee: simplify argv handling</title>
<updated>2015-10-04T00:02:43Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2015-10-04T00:01:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=88a7228bb2aafb2efb5a7b5de5348ac8105ad9b1'/>
<id>urn:sha1:88a7228bb2aafb2efb5a7b5de5348ac8105ad9b1</id>
<content type='text'>
* src/tee.c (tee_files): Last arg is now char ** instead of char
const **, as that is a bit simpler.  All callers changed.  Modify
files[-1], not files[nfiles], as that is a bit faster and simpler.
Latter problem pointed out by Rainer Deyke in:
http://bugs.gnu.org/21611
</content>
</entry>
<entry>
<title>doc: clarify in --help/man where short options take no param</title>
<updated>2015-08-31T17:10:41Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2015-08-31T17:07:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=a83f703a9bf9412417be94848a4ed7b7f1c1fc4a'/>
<id>urn:sha1:a83f703a9bf9412417be94848a4ed7b7f1c1fc4a</id>
<content type='text'>
* src/shred.c (usage): For -u, separate the decscription
of the short and long option, to clarify that the short option
takes no parameter.
* src/split.c (usage): Likewise for -d.
* src/tee.c (usage): Likewise for -p.
* src/uniq.c (usage): Likewise for -D.

Suggested by Stephane Chazelas
</content>
</entry>
<entry>
<title>tee: generalize the --write-error option to --output-error</title>
<updated>2015-03-04T13:24:21Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2015-03-02T20:06:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=5e9c277f995c517e4403c87e74b758d5b65004f2'/>
<id>urn:sha1:5e9c277f995c517e4403c87e74b758d5b65004f2</id>
<content type='text'>
Adjust commit v8.23-140-gfdd6ebf to add the --output-error option
instead of --write-error, and treat open() errors like write() errors.

* doc/coreutils.texi (tee invocation): s/write-error/output-error/.
* src/tee.c (main): Exit on open() error if appropriate.
* tests/misc/tee.sh: Add a case to test open() errors.
* NEWS: Adjust for the more general output error behavior.

Suggested by Bernhard Voelker.
</content>
</entry>
<entry>
<title>tee: add --write-error to control handling of closed pipes</title>
<updated>2015-02-24T18:12:22Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2015-02-16T12:55:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=fdd6ebf0ae786681e99afdaf1ef44bb750e66b2d'/>
<id>urn:sha1:fdd6ebf0ae786681e99afdaf1ef44bb750e66b2d</id>
<content type='text'>
tee is very often used with pipes and this gives better control
when writing to them.  There are 3 classes of file descriptors
that tee can write to: files(1), pipes(2), and early close pipes(3).
Handling write errors to 1 &amp; 2 is supported at present with the caveat
that failure writing to any pipe will terminate tee immediately.
Handling write errors to type 3 is not currently supported.
To improve the supported combinations we add these options:

 --write-error=warn
   Warn if error writing any output including pipes.
   Allows continued writing to still open files/pipes.
   Exit status is failure if any output had error.
 --write-error=warn-nopipe, -p
   Warn if error writing any output except pipes.
   Allows continued writing to still open files/pipes.
   Exit status is failure if any non pipe output had error.
 --write-error=exit
   Exit if error writing any output including pipes.
 --write-error=exit-nopipe
   Exit if error writing any output except pipes.

Use the "nopipe" variants when files are of types 1 and 3, otherwise
use the standard variants with types 1 and 2.  A caveat with the above
scheme is that a combination of pipe types (2 &amp; 3) is not supported
robustly.  I.e. if you use the "nopipe" variants when using both type
2 and 3 pipes, then any "real" errors on type 2 pipes will not be
diagnosed.
  Note also a general issue with type 3 pipes that are not on tee's
stdout, is that shell constructs don't allow to distinguish early
close from real failures.  For example `tee &gt;(head -n1) | grep -m1 ..`
can't distinguish between an error or an early close in "head" pipe,
while the fail on the grep part of the pipe is distinguished
independently from the resulting pipe errors.  This is a general
issue with the &gt;() construct, rather than with tee itself.

* NEWS: Mention the new feature.
* doc/coreutils.texi (tee invocation): Describe the new option.
* src/tee.c (usage): Likewise.
(main): With --write-error ignore SIGPIPE, and handle
the various exit, diagnostics combinations.
* tests/misc/tee.sh: Tess all the new options.
Fixes http://bugs.gnu.org/11540
</content>
</entry>
<entry>
<title>tee: close "-" file</title>
<updated>2015-02-23T10:39:08Z</updated>
<author>
<name>Bernhard Voelker</name>
<email>mail@bernhard-voelker.de</email>
</author>
<published>2015-02-23T00:57:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=19d34d244b46227e83ec43969f99c5e3b23ea01d'/>
<id>urn:sha1:19d34d244b46227e83ec43969f99c5e3b23ea01d</id>
<content type='text'>
This is a cleanup to the previous commit v8.23-138-g7ceaf1d.

* src/tee.c (tee_files): Do not exempt the "-" file from being closed,
as this is no longer stdout but a normal file.
</content>
</entry>
<entry>
<title>tee: treat '-' operand as file name as mandated by POSIX</title>
<updated>2015-02-20T13:00:41Z</updated>
<author>
<name>Bernhard Voelker</name>
<email>mail@bernhard-voelker.de</email>
</author>
<published>2015-02-20T07:10:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=7ceaf1d975a17d07f1704d8edf4476218148cfba'/>
<id>urn:sha1:7ceaf1d975a17d07f1704d8edf4476218148cfba</id>
<content type='text'>
Since v5.2.1-1247-g8dafbe5, tee(1) treated '-' as stdout while POSIX
explicitly requires to treat this as a file name.  Revert this change,
as the interleaved output - due to sending another copy of input to
stdout - is not considered to be useful.  Discussed in
http://lists.gnu.org/archive/html/coreutils/2015-02/msg00085.html

* src/tee.c (tee_files): Remove the special handling for "-" operands.
(usage): Remove the corresponding sentence.
* doc/coreutils.texi (common options): Remove the "tee -" example.
(tee invocation): Document that tee(1) now treats "-" as a file name.
* tests/misc/tee.sh: Add a test case for "tee -".
While at it, re-indent the above multi-argument processing case and
extend that to 13 operands, as POSIX mandates that, too.
* tests/misc/tee-dash.sh: Remove now-obsolete test.
* tests/local.mk (all_tests): Remove the above test.
* NEWS (Changes in behavior): Mention the change.
</content>
</entry>
</feed>
