There is a daemon process listening on port 5144, which I cannot to modify.
I want to use netcat to send the contents of a text file to the server, but this causes netcat
to hang the terminal until I press Ctrl+C:
cat file.txt | nc -u 127.0.0.1 5144
The only way I am able to get it to work is by running nc -u 127.0.0.1 5144
and copy/pasting the contents of the file manually.
Any ideas?
Also note:
cat file.txt | ...
leads tobash: ...: command not found
and I can continue to use the terminal- using
nc -u 127.0.0.1 5144 < file.txt
leads to the same behavior as using | above
cat file.txt | …
? How aboutnc -u 127.0.0.1 5144 < file.txt
?bash: ...: command not found
and using "< file.txt" does the same as the | operator (netcat just hangs)bash: ...: command not found
”? Or does it say “bash: cat: command not found
” or “bash: nc: command not found
”? And then does it then exit to a shell prompt, or does it hang? (I encourage you to edit the question to add these details, so people in Australia who are just now waking up don’t have to read through all these comments to find out what your symptoms are.)