WRITE a message in console


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting WRITE a message in console
# 1  
Old 09-01-2008
Question WRITE a message in console

Hi all,

I have a requirement, where I need to do some calculations and based on the results I need to write a message to the user from a shell script.

Is it possible to `write' inside the script? Something like the below one..
Code:
#! /bin/ksh

write user12 << EOF
Hello World
<<EOF

For me, it produced an error.
Code:
wrt[6]: here document `EOF' unclosed

Any idea please?
# 2  
Old 09-01-2008
Quote:
Originally Posted by guruparan18
Hi all,

I have a requirement, where I need to do some calculations and based on the results I need to write a message to the user from a shell script.

Is it possible to `write' inside the script? Something like the below one..
Code:
#! /bin/ksh

write user12 << EOF
Hello World
<<EOF

For me, it produced an error.
Code:
wrt[6]: here document `EOF' unclosed

Any idea please?
Try this:

Code:
write user12 << EOF
Hello World
EOF

# 3  
Old 09-01-2008
Silly mistake.. Isn't it?!

Thanks a lot Dennis.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Changes to write output to logfile and console

Friends, Below is the script which writes output to LOGFILE, however I want the entire log written to LOGFILE and also console. Please suggest me the changes I need to do here. #!/bin/ksh x=${0##*/} LOGFILE="x.log" echo "CAUTION : Files once deleted cannot be restored" printf 'Would... (8 Replies)
Discussion started by: fop4658
8 Replies

2. Shell Programming and Scripting

How to change banner message for console login?

Hi All, Whenever I login to server via console, after providing username (root) it displays a banner message. I want to remove this message Serverabc : root Welcome to Server !!! Password: It is Centos 5.4 box. I have checked /etc/issue and /etc/motd. It does not... (8 Replies)
Discussion started by: kalpeer
8 Replies

3. OS X (Apple)

Write message to another user on same network

On our home network, with 2 Macbook pros running OS X 10.6.*, I would like be able to popup a message to the user of the other computer. Is there a way I can "call" from one computer to another not using skype, or ichat or any application that the user has to have running? I guess first I... (8 Replies)
Discussion started by: allelopath
8 Replies

4. UNIX for Dummies Questions & Answers

how to stop the message on the console

Hi, Sun Solaris. I am working on the console, I have pulled the network cable out. I am in the process of changing the IP address and few others thing. But this message comes every few seconds. SUNW,hme0: Link Down - cable problem? SUNW,hme0: Link Down - cable problem? It's very... (2 Replies)
Discussion started by: samnyc
2 Replies

5. UNIX for Advanced & Expert Users

Send console message to all users and tty

Hi people, i tried to search in the forum... but didnt found the answer... Sometimes i need to send a console message to all users in all tty, like reboot or shutdown does... But i cant find how to do that. Someone know? Thanks a lot (2 Replies)
Discussion started by: gfca
2 Replies

6. Shell Programming and Scripting

To write to console and file

Hi, How can i redirect the traces to both the console and to a file.. The way i was doing was: /home/harika/harika/samp.exe if ; then echo "executed the first exe.." >> /dev/console;/home/harika/harika/trace.txt /home/harika/harika/memset.exe echo "executed the... (1 Reply)
Discussion started by: harikamamidala
1 Replies

7. UNIX for Dummies Questions & Answers

console message from Crontab run

I run my nightly backup thru a crontab job. Is there any way to get the message to mount a new tape to the console? Currently it appears to go to an email. (1 Reply)
Discussion started by: aixhelp
1 Replies

8. UNIX for Dummies Questions & Answers

How do i access (mount, read & write) a floppy disk from the console, not being root?

welll, the title quite explains what i want to do thanks for your time! (4 Replies)
Discussion started by: kfaday
4 Replies

9. UNIX for Dummies Questions & Answers

console error message

:confused: I receive the following error message when I try to logon to my Solaris 2.6 system; "No utmpx entry. You must exec "login" from lowest level "shell" " What does it mean ? I can't logon to the system at the moment! Any help appreciated. Regards (3 Replies)
Discussion started by: boristhespider
3 Replies
Login or Register to Ask a Question