#/bin/sh
# $1 program
# $2 file
set -ex
prog="$1"
file="$2"
name=${file%.*}
ext=${file##*.}
ln -f "$file" "$name.tmp.$ext"
$prog "$name.tmp.$ext"
rm -f "$name.tmp.$ext"