LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 10-27-2005, 11:16 PM   #1
naihe2010
Member
 
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
CroMagnon
Member
 
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
randyding
Member
 
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
jlliagre
Moderator
 
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" (http://netcat.sourceforge.net/)
 
Old 10-29-2005, 03:28 PM   #5
eddiebaby1023
Member
 
Registered: May 2005
Posts: 378

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


Reply



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:28 PM.

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