Hi,

The traditional netcat had a -e option to "Execute the specified command, using data from the network for stdin, and sending stdout and stderr to the network..." Whilst I can understand that this option might not be desirable to be included in the binary (for security reason ?), I occasionally find it very useful, and so emulate it with a shell script:

$ cat wetcat
#!/bin/ksh
CMD="$*"
LISTEN_PORT=1234
MYPID=$$
FIFO=/tmp/${RANDOM}_${MYPID}.fifo
mkfifo -m 600 $FIFO
($CMD < $FIFO )  2>&1 | nc -l $LISTEN_PORT > $FIFO
rm $FIFO

If others would find it useful too, maybe it could be added to the examples section of the nc(1) man page ?

/Pete

Reply via email to