#!/bin/bash
n=0
for f in "$@" ; do
    case "$f" in
    *.gz)
        fu="/tmp/$n-$(basename "${f/.gz}")"
        n=$(( $n + 1 ))
        gzip -d < "$f" > "$fu"
        files[${#files}]="$fu"
        ;;
    *)
        files[${#files}]="$f"
        ;;
    esac
done
for f in /usr/bin/acroread /opt/bin/acroread /opt/local/bin/xpdf /usr/local/bin/xpdf /usr/bin/xpdf ; do
    [ -x $f ] && exec $f -geometry 800x990++0 "${files[@]}"
done
printf "Sorry, there's no acrobat reader installed on this computer.\n"
printf "Try Preview.app (use open).\n"
exit 1
#### THE END ####
ViewGit