If I go to a bash prompt and run the following command (to flush memcached):
echo "flush_all" | /usr/bin/nc 172.16.198.130 11211
it works and returns "OK".
If I put that same command in a one-line bash script:
#!/bin/sh `echo "flush_all" | /usr/bin/nc 172.16.198.130 11211`
I get the following output:
: command not found OK
Is it trying to process "OK" as a second command? How can I prevent this (short of redirecting to /dev/null)?