Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-27-2005, 11:16 PM   #1
Registered: Oct 2005
Location: China
Distribution: ArchLinux
Posts: 103

Rep: Reputation: 15
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 ?
Old 10-28-2005, 01:11 AM   #2
Registered: Sep 2004
Location: New Zealand
Distribution: Debian
Posts: 900

Rep: Reputation: 33
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.
Old 10-28-2005, 01:12 AM   #3
Registered: May 2004
Posts: 552

Rep: Reputation: 31
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.
Old 10-28-2005, 01:16 AM   #4
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Bash cannot internally, but bash (or any other shell) can call a command that do it. One matching your need is "nc" (
Old 10-29-2005, 03:28 PM   #5
Registered: May 2005
Posts: 378

Rep: Reputation: 33
Perl would be the scripting language of choice for this task (IMO).


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Send a message via command line without sendmail daemon. sonenberk Linux - Software 1 11-22-2005 01:31 AM
how to send a message to one sys to another. bruse Linux - Networking 4 06-20-2005 03:46 AM
how do i send private message in edonkey/overnet hybrid command line client? pyenos Linux - Software 0 03-12-2005 06:30 AM
How to use command to send message to others? chinaundead Linux - General 4 05-09-2004 09:09 PM
linux command error message bash: /usr/bin/find: No such file or directory sundaram123 Linux - General 8 04-02-2002 07:18 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:31 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration