Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

write(1) [ultrix man page]

write(1)						      General Commands Manual							  write(1)

       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 Also
       mail(1), mesg(1), who(1)


Check Out this Related Man Page

WRITE(1)						    BSD General Commands Manual 						  WRITE(1)

write -- send a message to another user SYNOPSIS
write user [ttyname] DESCRIPTION
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 over. 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 place. 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
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

su permission

Hi Forums, 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)
Discussion started by: siavoush
12 Replies

2. Shell Programming and Scripting

File read & execute problem

Hi folks, 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)
Discussion started by: tipsy
5 Replies

3. UNIX for Dummies Questions & Answers

how to read lines one by one from a file

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)
Discussion started by: bihani4u
5 Replies

4. Programming

read terminal command

hi how to read terminal command, just i want to read all command which write on terminal so please tell me any system call, api avilable in c for above purpose (6 Replies)
Discussion started by: munnu
6 Replies

5. Shell Programming and Scripting

write a c program that simulates ls command

i need the a c program that simulates the "ls" command:b: (5 Replies)
Discussion started by:
5 Replies

6. UNIX for Dummies Questions & Answers

write new line at the beginning of an existing file

I was trying to find out the easiest way to write new line to the beginning of an exisiting file. I am using KSH. (5 Replies)
Discussion started by: sailussr
5 Replies

7. UNIX for Dummies Questions & Answers

About read,write & execute permissons of a directory

Hi all, I want to know differences between read,write & execute permissons given to directory. Thanx in advance. (6 Replies)
Discussion started by: vishwasrao
6 Replies

8. Shell Programming and Scripting

How to 'write' to a user, lgged from 'su'?

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)
Discussion started by: alex_5161
11 Replies

9. Shell Programming and Scripting

Help with excelsheet generation

Hi All, 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)
Discussion started by: Amit.Sagpariya
4 Replies

10. Shell Programming and Scripting

Read/write file with scripting

Is there any way to write to a text file with scripting? I need to write to a text file two lines of text for the amount of files in the current directory. (9 Replies)
Discussion started by: Fred Goldman
9 Replies

11. Shell Programming and Scripting

How to display message when starting a terminal

Hello all, 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)
Discussion started by: mrudula009
27 Replies

12. Shell Programming and Scripting

Switch to different user without expect

Hi, 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)
Discussion started by: sugan
4 Replies

13. Shell Programming and Scripting

temp files

Hi there, 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)
Discussion started by: cyberfrog
6 Replies

14. Shell Programming and Scripting

who command from non terminal in unix

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)
Discussion started by: lalitpct
4 Replies

15. Shell Programming and Scripting

How to write this script:- check output word and send a mail?

Hi Guys, 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 -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)
Discussion started by: manalisharmabe
20 Replies