gzip: port zgrep to Solaris 11.2
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 6 Mar 2016 08:17:41 +0000 (00:17 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 6 Mar 2016 08:18:30 +0000 (00:18 -0800)
commit61cd88ef7492a180e2d91d110db116e8a8f7c049
tree5266ba83d4f71e8bd70d939720f5f90dc56c9d70
parent3471e27de87bb81abd6aa67f4391d3fce9a35437
gzip: port zgrep to Solaris 11.2

Problem reported by Assaf Gordon in: http://bugs.gnu.org/22900#11
* zgrep.in: Port to Solaris 11.2 /bin/sh (ksh 93u 2011-02-08),
where $? is 256+SIG when a process was killed with signal SIG, and
where 'exit 257' is equivalent to 'exit 1'.  Apparently some other
sh implementations use 256+128+SIG.  So, instead of using plain
'exit $?', use the equivalent of 'exit ((128 * (128 <= $?)) + $? %
128)' within the script, and use the equivalent of 'kill -$($? %
128)' at the top level if the exit status is 128 or more.
zgrep.in