write(1) General Commands Manual write(1)Name
write - write message to another user
write user [ttyname]
The command copies lines from your terminal to that of another user. When first called, it sends the message
Message from yoursystem!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 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 and disallow messages in order to prevent messy output.
If the character `!' is found at the beginning of a line, calls the shell to execute the rest of the line as a command.
The following protocol is suggested for using 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. The letter `o' is the convention for `over' which indicates that the message
is complete. The letters `oo' are the convention for `over and out' which is used when the conversation is about to be terminated.
/etc/utmp to find user
/bin/sh to execute `!'
See Alsomail(1), mesg(1), who(1)write(1)
Check Out this Related Man Page
WRITE(1) BSD General Commands Manual WRITE(1)NAME
write -- send a message to another user
write user [ttyname]
The write utility allows you to communicate with other users, by copying lines from your terminal to theirs.
When you run the write command, the user you are writing to gets a message of the form:
Message from yourname@yourhost on yourtty at hh:mm ...
Any further lines you enter will be copied to the specified user's terminal. If the other user wants to reply, they must run write as well.
When you are done, type an end-of-file or interrupt character. The other user will see the message 'EOF' indicating that the conversation is
You can prevent people (other than the super-user) from writing to you with the mesg(1) command.
If the user you want to write to is logged in on more than one terminal, you can specify which terminal to write to by specifying the termi-
nal name as the second operand to the write command. Alternatively, you can let write select one of the terminals - it will pick the one
with the shortest idle time. This is so that if the user is logged in at work and also dialed up from home, the message will go to the right
The traditional protocol for writing to someone is that the string '-o', either at the end of a line or on a line by itself, means that it's
the other person's turn to talk. The string 'oo' means that the person believes the conversation to be over.
SEE ALSO mesg(1), talk(1), wall(1), who(1)HISTORY
A write command appeared in Version 1 AT&T UNIX.
BSD June 6, 1993 BSD
It seems to me that I can't use "su" command. When I type "su", I get the following message:
/sbin/su - Permission denied
Am I missing any thing?
By the way I am using IRIX6.5 on a SGI computer. Many thanks in advance for your help.
Cheers, Siavoush (12 Replies)
Need your help.
I am writing a KSH script to read a few commands from a file & execute.
I am using the following code to read the file line by line & excute each command. When I am printing each line I see it is printing properly but while excuting, the particular "ps" command... (5 Replies)
I have one file in which some commands have written line line
i have to read lines from this file(file name passed as avariable)
and then i have to execute these commands..
how can i do it? (5 Replies)
I have a situation, where some script (running background) need to use the 'write' command and get a text to appeared on any screen of some particular user.
Like:>echo "$message"|write user1
But I surprisingly realized, that if a person logged under any other name and after that uses the 'su'... (11 Replies)
i have around 50 queries in sybase.
We have a requirement where we need to write a unix script, which execute the query one by one & generate the excel sheet & send it to user.
I have completed half of the part, where i am executing query one by one & putting the result into a .txt... (4 Replies)
I would like a message to be displayed on the shell when someone opens up the terminal - something like a welcome msg with date and time. I know how to do this by running the shell commands but dont know how to display it when a user opens up the terminal?
Thanks in advance (27 Replies)
I have to switch to a different user and execute certain commands and then come back to the original user
Ex: My id is 'usstage'. I need to switch to 'apstage', souce a script there, execute a function and then get back again to usstage.
Please note that I do not have expect installed... (4 Replies)
As a regular unix user I am forever programming on the command line or writing scripts so that I first write a load of data to a file to read from. In the end I am always left with a bundle of .txt, .tmp which is what I usually call them. As a basic programmmer I was wondering is... (6 Replies)
I was executing a command "who -ms" from a CHUI application but i get below message,
It seems that who command can be executed only when we are logged directly in unix box as we have terminal.
Is there a way to get rid of this problem , or anyother command where i can get machine name of the... (4 Replies)
I am not Good at scripting.
I need to write a script such that if output of command shows the particular word in output then send mail to email@example.com
-bash-3.2$ ps -ef | grep bpbkar
root 6040 1 0 13:05:19 ? 0:00 bpbkar -r 2678400 -ru root -dt 47395 -to 0... (20 Replies)