#!/bin/bash HOST=1.1.1.1 PORT=7777 if [ "$1" != "-" ]; then echo -e "\n"$*"\nexit" | nc $HOST $PORT exit fi shift 1 cmd= if [ "$*" != "" ]; then cmd="$* " fi while read line do echo -e "\n"$cmd$line"\nexit" | nc $HOST $PORT done
#!/bin/bash HOST=1.1.1.1 PORT=7777 if [ "$1" != "-" ]; then echo -e "\n"$*"\nexit" | nc $HOST $PORT exit fi shift 1 cmd= if [ "$*" != "" ]; then cmd="$* " fi while read line do echo -e "\n"$cmd$line"\nexit" | nc $HOST $PORT done