-   Programming (
-   -   If bash command can send message to a host ? (

naihe2010 10-27-2005 11:16 PM

If bash command can send message to a host ?
I want to use bash command to send message to a host ,just like "socket "in C language.

If the bash can do this ?

CroMagnon 10-28-2005 01:11 AM

As far as I know, Bash by itself can't do this, but you could look into the netcat package, which gives you an easy way to send and receive data across the network.

randyding 10-28-2005 01:12 AM

Bash has no builtin for this directly, however you surely can use a bash script to run a standard program like nc (netcat).
It can be configured to copy stdin -> socket -> stdout, which sounds like what you're looking for.

jlliagre 10-28-2005 01:16 AM

Bash cannot internally, but bash (or any other shell) can call a command that do it. One matching your need is "nc" (

eddiebaby1023 10-29-2005 03:28 PM

Perl would be the scripting language of choice for this task (IMO).

All times are GMT -5. The time now is 04:20 PM.