- set -- barcat "$file.in"
- case "$name" in *\ -*) set -- "$@" "-${name#* -}";; esac
- case "$name" in *' |'*) set -- sh -c "\$0 \$1 $3" "$@";; esac
+
+ set -- barcat
+ [ -r "$input" ] && set -- "$@" "$input"
+ case "$name" in
+ *\ -*)
+ args="${name#* -}"
+ set -- "$@" -"${args% [?|]*}"
+ ;;
+ esac
+ case "$name" in
+ *' ?' ) set -- sh -c "\$0 \$@ 2>/dev/null" "$@";;
+ *' ?'*) set -- sh -c "\$0 \$@ | test \$\? = ${name#* \?}" "$@";;
+ *' |'*) set -- sh -c "\$0 \$@ | ${name#* |}" "$@";;
+ *) eval set -- "$1" $2 $3
+ esac