[olug] Bash TCP scripting

Jay Hannah jay at jays.net
Fri Dec 28 22:15:56 UTC 2007


On Dec 28, 2007, at 3:32 PM, Travis Owens wrote:
> Just out of curiosity, has anyone ever done any scripting with  
> bash, using
> /dev/tcp or some form of socket connections? I'm looking at doing  
> something
> bi-directional, receiving the response after the connection is  
> established,
> parsing it, using a piece to send back and parsing the final response.

Why bash? Are you writing a client or a server or both?

I'm a big fan of Perl's IO::Multiplex. Here's a chat server in 20  
lines of code:

http://search.cpan.org/~bbb/IO-Multiplex-1.09/lib/IO/ 
Multiplex.pm#A_server_example

Cheers,

j
Omaha Perl Mongers: http://omaha.pm.org





More information about the OLUG mailing list