allow passing arguments to read command wiht -R "args"
This commit is contained in:
@@ -5,7 +5,13 @@ if [ "x$1" = "x-p" ]; then
|
|||||||
port=$1
|
port=$1
|
||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
|
readargs=
|
||||||
|
if [ "x$1" = "x-R" ]; then
|
||||||
|
shift
|
||||||
|
readargs=$1
|
||||||
|
shift
|
||||||
|
fi
|
||||||
for i in `echo "f" "$@"|nc localhost $port|cut -d ' ' -f '1-2'|sed -e 's# #:#'`; do
|
for i in `echo "f" "$@"|nc localhost $port|cut -d ' ' -f '1-2'|sed -e 's# #:#'`; do
|
||||||
ret=`echo "r -c" ${i%%:*} ${i##*:}|nc localhost $port|head -n 1`
|
ret=`echo "r ${readargs} -c" ${i%%:*} ${i##*:}|nc localhost $port|head -n 1`
|
||||||
echo ${i%%:*} ${i##*:} "=" $ret
|
echo ${i%%:*} ${i##*:} "=" $ret
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user