#!/bin/sh # Script for automatic compilation (or interpretation) of various file types # The filename needs to be passed to this script as the only argument file="$1" base="${file%.*}" ext="${file##*.}" case $ext in mom) groff -mom -Tpdf "$file" > "$base.pdf" ;; ms) groff -me -Tpdf "$file" > "$base.pdf" ;; me) groff -me -Tpdf "$file" > "$base.pdf" ;; py) python3 "$file" ;; esac