# get data either from stdin or from a file
buf=$(cat -- "$@")
# if cmd is resolved, do cmd
[ -n "${cmd}" ] && printf '%b' "${buf}" | eval "${cmd}"
