linux - Writing output from a socket -


i have 2 machines , b.

in machine a, do

echo "hello world" > /dev/tcp/{bs_ip}/12345 

in machine b, how write script runs in background, listens on port 12345, , prints whatever receives port 12345 stdout?

btw both machines running red hat enterprise linux 4.

thanks

you can using netcat:

nc -l -p 123456 

if want able handle multiple connections have use loop.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -