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

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

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