#! /bin/sh for args in $*; do case $args in --outdir*) cd `expr $args : '--outdir[^=]*=\(.*\)'` ;; --dir*) cd `expr $args : '--dir[^=]*=\(.*\)'` ;; --*) ;; *) if test -z "$infile"; then infile=$args else touch $args fi ;; esac done