On Apr 29, 2013, at 11:27 AM, Antonio Diaz Diaz wrote: > Paul Eggert wrote: >> If you look at the gzip source code you'll >> find a number of circumstances that will >> cause it to exit with status 2, as a warning. > > Then gzip's API differs from compress's API[1] (return 2 only if size > increases and -f is not specified), and from "standard" API (only 0 means > success). > > [1]http://pubs.opengroup.org/onlinepubs/9699919799/utilities/compress.html > > The following exit values shall be returned: > 0 Successful completion. > 1 An error occurred. > 2 One or more files were not compressed because they would have > increased in size (and the -f option was not specified). > >2 An error occurred.
If you look at the source code for "compress", you find that the return code 2 is *only* used when compressing files in-place. It does not apply when compressing stdin to stdout. I believe GNU tar forks compressors to compress from stdin to stdout, so this should never occur. Tim