diff --git a/tests/bin/nc b/tests/bin/nc index d74e918..40a24fb 100755 --- a/tests/bin/nc +++ b/tests/bin/nc @@ -6,11 +6,17 @@ local_port=1024 case "$input" in -*) echo "nc: bad input: \$input" >&2; exit 1;; esac -while [ ! -z $1 ]; do - case $1 in +while [ ! -z "$1" ]; do + case "$1" in -w) shift 2;; - -p) local_port=$2; shift 2;; - *) if [ -z $host ]; then host=$1; elif [ -z $port ]; then port=$1; fi; shift 1;; + -p) local_port="$2"; shift 2;; + *) if [ -z "$host" ]; then + host="$1" + elif [ -z "$port" ]; then + port="$1"; + fi + shift 1 + ;; esac done