case case "$1" in -d*) cmd="diff" ;; -c*) cmd="cmp" ;; *) exit 1 ;; esac $cmd file1.txt file2.txt