So here's how to repeat the trick in Bash:
For user agents that do not accept gzip-encoded output we use cat(1) as a straight pass-thru as there is no 'nice way' to put nil afer a pipe sign (|) in Bash.#!/bin/sh
gz_pipe='cat';
echo $HTTP_ACCEPT_ENCODING | grep -qw gzip && {
gz='ok'; gz_pipe='gzip -9f';
}
echo "Content-Type: text/html";
[ ! -z "$gz" ] && echo "Content-Encoding: gzip";
echo '';
{
echo '<html><PRE>';
set
ps axf
echo '</PRE></html>';
} | $gz_pipe
-ulianov