Sponsored Content
Top Forums Shell Programming and Scripting "Write" - how to quit by press enter Post 302368690 by Eriknem on Thursday 5th of November 2009 10:41:28 AM
Old 11-05-2009
"Write" - how to quit by press enter

I need to make Bash script. It has one parameter - user ID. If this user is online you can write him a message with "write" program, but only one line. After pressing ENTER "write" program should quit. Normally when you run "write" you can write next line after pressing ENTER and you can quit "write" with ctrld+d. What possibilities I have?

How can I send variable with "write"?
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

communicating wth another user aside from "wall" and "write"

Hi, Can anyone suggest a Unix command or c-shell algorithm to simulate to behavior of "wall" command minus the "all users"? What I'm trying to do is to send a notice to just one particular user but i dont want other remotely-logged-on users to receive the message (on the pseudo-terminals). I... (6 Replies)
Discussion started by: Deanne
6 Replies

2. Shell Programming and Scripting

Grep & EMail "HOW to quit ??? "

Hello All, I am using the below code to grep particular word from file and then emailing it through mail command. the problem is this that when i run the script so it stops and ask me for the mail body then it asks for cc: and then runs. I dont want to give body and cc: address, i just want... (1 Reply)
Discussion started by: wakhan
1 Replies

3. Shell Programming and Scripting

read -n1 -r -p "Press..." key / produces error in bash shell script

Hello! Sorry, for my not so perfect english! I want to stop bash shell script execution until any key is pressed. This line in a bash shell script read -n1 -r -p "Press any key to continue..." key produces this error When I run this from the command line usera@lynx:~$ read... (4 Replies)
Discussion started by: linuxinho
4 Replies

4. Shell Programming and Scripting

Make scipt except from "Y","y" and "yes" to take [Enter] as being "yes"

This is the script: #!/bin/sh if ; then rm -rf /usr/share/WallpaperChanger; fi if ; then rm -rf /usr/bin/wallch; fi; if ; then rm -rf /usr/share/applications/wallch.desktop; fi if ; then rm -rf /usr/share/doc/wallch; fi if ; then rm -rf /usr/share/man/man1/wallch.1.gz; fi echo "Delete... (4 Replies)
Discussion started by: hakermania
4 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

Syntax error near unexpected token `"Hit <ENTER> to continue:"'

the below code will search attr string inside makefile under the modelno on given path. echo "Enter model no for searching string inside makefile" read inputs2 #find /pools/home_unix/sapte/work/models/model/$inputs2 -name "makefile" | xargs grep "attr" \; #;;I am getting below error.... (7 Replies)
Discussion started by: lathigara
7 Replies

7. Shell Programming and Scripting

Script that automatically issue "yes" and press enter

Team, Got a thousand servers. I created a script to say hello on every server. But is there a script or whatever that will issue a yes on every key checking. for i in `cat myserverlist` do echo $i ssh-copy-id $i done The authenticity of host 'server1 (162.162.0.10)' can't be... (7 Replies)
Discussion started by: invinzin21
7 Replies
WRITE(1)						      General Commands Manual							  WRITE(1)

NAME
write - write to another user SYNOPSIS
write user [ ttyname ] DESCRIPTION
Write copies lines from your terminal to that of another user. When first called, it sends the message Message from yourname yourttyname... The recipient of the message should write back at this point. Communication continues until an end of file is read from the terminal or an interrupt is sent. At that point write writes `EOT' on the other terminal and exits. If you want to write to a user who is logged in more than once, the ttyname argument may be used to indicate the appropriate terminal name. Permission to write may be denied or granted by use of the mesg command. At the outset writing is allowed. Certain commands, in particu- lar nroff and pr(1) disallow messages in order to prevent messy output. If the character `!' is found at the beginning of a line, write calls the shell to execute the rest of the line as a command. The following protocol is suggested for using write: when you first write to another user, wait for him to write back before starting to send. Each party should end each message with a distinctive signal--(o) for `over' is conventional--that the other may reply. (oo) for `over and out' is suggested when conversation is about to be terminated. FILES
/etc/utmp to find user /bin/sh to execute `!' SEE ALSO
mesg(1), who(1), mail(1) WRITE(1)
All times are GMT -4. The time now is 05:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy