1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#!/bin/sh if [ $# \!= 3 ]; then 1>&2 echo 'usage: employ.sh <host> <port> <file>' exit 1 fi host="$1" port="$2" file="$3" { echo -n 'NEW JOB ' stat -c %s "$file" cat "$file" echo 'MARK AS available' echo QUIT } | nc "$host" "$port"