How do I achieve the equivalent of nc -q in Redhat 5?


Details?

nc -q -1 local host ${PORT} ${CMD}

In Ubuntu, nc may be use 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. (Note: The Red Hat website is horrible to search, if someone finds their manpage for nc, please edit this post or comment with the new link).

link|improve this question

75% accept rate
feedback

1 Answer

What do you want that option for? If you explain the use case, maybe we can come up with an alternative.

For example, maybe

while 1; do
    nc localhost ${PORT}
done

is sufficient?

I think the linux.die.net man pages is from RHEL5, but not 100% sure.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.