LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-20-2009, 01:19 AM   #1
gr8linux
Member
 
Registered: May 2009
Posts: 44

Rep: Reputation: 15
Post echo to other system


is it possible that echo a message to other computer system within network by echo command?
 
Old 05-20-2009, 03:13 AM   #2
pcardout
Member
 
Registered: Jun 2003
Location: Socorro, New Mexico
Distribution: Debian ("lenny", "squeeze"), Linux Mint, XUbuntu
Posts: 218

Rep: Reputation: 24
Echo does not do what you want -- try talk or gaim

"echo" is limited to the terminal window you are in -- not for
other machines.

I think the command you want is "talk"

http://linux.about.com/od/commands/l/blcmdl1_talk.htm

It is a very old unix command. I have never been able to really
make it work.

Much more modern things like AIM work in Linux.
The AIM package is called "gaim" (gnu aim).

If you do make "talk" work -- tell us what you had to do!
 
Old 05-20-2009, 04:37 AM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
You can try wall over ssh. For example if you want to send a message to all the users logged into 192.168.0.1
Code:
ssh root@192.168.0.1 wall << EOF
> type the message here
> EOF
if you want to send a message to all the machines connected to the local network using multiple addresses, just embed this code in a for loop:
Code:
for IP in 192.168.0.{1..8}
> do
> ssh root@$IP wall << EOF
> type your message here
> EOF
> done
The only disadvantage is that you have to type the root password for all the machines in the local network, unless you setup the public/private key authentication to let ssh connect without password.
 
Old 05-20-2009, 04:51 AM   #4
kpraveen455
Member
 
Registered: Feb 2009
Location: Hyderabad
Distribution: fedora
Posts: 33

Rep: Reputation: 17
Smile Little correction

Little correction here..., use "-n" to execute a command on a remote machine.

ssh -n root@192.168.0.1 "wall << EOF
>type the message here
>>" EOF
 
Old 05-20-2009, 04:55 AM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Quote:
Originally Posted by kpraveen455 View Post
Little correction here..., use "-n" to execute a command on a remote machine.

ssh -n root@192.168.0.1 "wall << EOF
>type the message here
>>" EOF
Why??? In this case the -n option does not work because it prevents reading from standard input. The message to wall is not read if you use the -n option!
 
Old 05-20-2009, 05:30 AM   #6
kpraveen455
Member
 
Registered: Feb 2009
Location: Hyderabad
Distribution: fedora
Posts: 33

Rep: Reputation: 17
Oops!! I meant to run a command on a remote machine using 'ssh'
 
Old 05-20-2009, 05:51 AM   #7
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Well... to clarify. It works with -n if you enclose all the command in double quotes (in this case the here document is created on the remote machine)
Code:
ssh -n root@192.168.0.1 "wall << EOF
> type the message here
> EOF
> "
It does not work if you take the here document as standard input from the local machine:
Code:
ssh -n root@192.168.0.1 wall << EOF
> type the message here
> EOF
in this case the double redirection is not sent to the remote machine, but takes input from the local terminal, so that if you redirect input from /dev/null it does not work.
 
Old 05-21-2009, 08:26 AM   #8
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by pcardout View Post
"echo" is limited to the terminal window you are in -- not for
other machines.

I think the command you want is "talk"

http://linux.about.com/od/commands/l/blcmdl1_talk.htm

It is a very old unix command. I have never been able to really
make it work.

Much more modern things like AIM work in Linux.
The AIM package is called "gaim" (gnu aim).

If you do make "talk" work -- tell us what you had to do!
Some times ago (on RedHat 3.0.3) talk just work.
And I have spent time to disable it.

OK, it was a time with all services running, without firewalls and with telnet and ssh
 
  


Reply


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
Turn off keyboard echo system wide abhinav.zoso Programming 3 04-28-2009 12:47 AM
ls | echo, I got blank, why can't echo take the 2nd seat in a pipeline? elinuxqs Linux - Newbie 6 11-24-2006 09:25 AM
Kphone echo (echo echo) scabies Linux - Software 0 10-18-2004 03:59 PM
using 'echo' in a system statment in php evilchild Programming 3 09-23-2004 03:27 PM
Echo /devPrinting doesn't work, echo /usb/lp0 works, Testpage works, Printing doesn't Hegemon Linux - General 3 08-15-2002 02:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:39 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration