5
nc -q -1 local host ${PORT} ${CMD}
In Ubuntu, nc
may be used as above, with the -q
option. See manpage.
-q
after EOF on stdin, wait the specified number of seconds and then quit. If seconds is negative, wait forever.
However, this option is not available in Redhat 5. See manpage. How do I achieve the equivalent of nc -q
in Redhat 5?
3
What version of netcat are you using? Did you compile from source, or install using your package manager? You might want to try compiling netcat from source, or attempting to compile the Ubuntu version on your Redhat machine. Also, it would be helpful to explain why you need this behaviour (specifically why you need to wait X seconds after EOF), as it might help to suggest alternative solutions.
– Breakthrough – 2015-06-22T05:17:54.343