#!/bin/sh for f in "$@" do test ${f: -3} = ".gz" && c="zcat" || c="cat" $c $f done