I’m using the netcat for unix.
when I run python script.py &> logfile.txt , it gets captured continuously.
To replicate this remotely, I tried nc -l -p 8011 on the listener (client) and the following for the sender (host or server) :
python script.py &> nc 127.0.0.1 8011python script.py > nc 127.0.0.1 8011nc 127.0.0.1 8011 < python script.py
But nothing seems to work. Please help.
Is this what you’re after?
Receiver:
Sender:
Make sure to run the receiver code first.
EDIT: In case you’re not aware there’s a lot of different versions of netcat; they all accept slightly different arguments (e.g.
nc.traditionalon Debian wantsnc -l -p 1234to listen on port 1234, whereas BSDnc(e.g. OS X) just wantsnc -l 1234andncatmay throw an interesting error unless you use the-4flag if your host doesn’t support IPv6) – read the man pages to find out what combination of options you actually want.