If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Sending message in Unix

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-01-04, 16:32
kmrs kmrs is offline
Registered User
 
Join Date: Oct 2004
Posts: 7
Sending message in Unix

Hi Frinz,
I want to send some message to some of my friends who have logged in at that time.I am using <B>"write"</B> command to do this in my script but what happening is some of the id which I am sending message has been logged in at more than one places because of this the command next to this command is not executing.

Below are the command I am using:

Notification_List="id1 id2 id3"

for write_List in $Notification_List
do
write $write_List << Message
Just for test
Good Morning
Message
echo "Message has been sent"

when executing this command it is saying

id2 is logged on more than one place.
You are connected to "pts/2".
Other locations are:
pts/10

and waiting there without terminating after execution.

Can any one tell the reasion for this and any way to solve this.

It will be great if any one help me in this regards.

- kmrs
Reply With Quote
  #2 (permalink)  
Old 11-02-04, 11:47
jmdevil jmdevil is offline
Registered User
 
Join Date: Oct 2003
Posts: 9
Well, the message about id2 on more than one terminal is expected behaviour. Now, for the hanging, it looks as if the loop is not handling well the "here" document. That would explain it, because write reads standard input. Try again and when it stops, press "Ctrl-D". If it returns you to the prompt, then the "here" document is your problem.

Could you double check the closing of your here document? It has to be exactly the same as the opening, and you cannot use any spaces to indent it.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On