#!/bin/sh HOST="${HOST:-localhost}" PORT="${PORT:-1965}" while getopts h:p: opt; do case "$opt" in h) HOST="$OPTARG";; p) PORT="$OPTARG";; *) usage;; esac done shift $((OPTIND - 1)) for x in "$@"; do fdwrap -f '3>stdin,stdin/dev/null" \ awk 'BEGIN { u = ARGV[1]; ARGV[1] = "-" gsub(/'\''/, "&\\&&", u) system("printf %s\\\\r\\\\n '\''" u "'\''>&3") while (getline) print }' "$x" done