A selection of random tests that have come up. This first one arose from using Debian's `debootstrap` scripts. $ cat > test.sh << EOF > set +e > echo x | grep --perl-regexp . >/dev/null 2>&1 > echo \$? > if [ \$? -eq 2 ]; then > gropt=-E > else > gropt=--perl-regexp > fi > set -e > echo \$gropt > EOF $ sh test.sh 0 --perl-regexp $ msh test.sh 0 --perl-regexp Another example from the Debian world, this time when installing the CA-certificates, the main idea is testing that piping works whenever their are compound commands thrown into the mixed. $ cat > test.sh << EOF > VAR="world,there,hello" > vars=\$( (echo "\$VAR" | tr ',' ' ') | rev) > echo "Vars are \$vars" > EOF $ sh test.sh Vars are olleh ereht dlrow $ msh test.sh Vars are olleh ereht dlrow