#!/bin/bash [ -z "$1" ] && echo "usage: $0 " && exit 1 FILE="$1" MIME=`file -bL --mime-type "$FILE"` exec run-mailcap --debug "$MIME:$FILE"