Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

write(1) [v7 man page]

WRITE(1)						      General Commands Manual							  WRITE(1)

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)

Check Out this Related Man Page

WRITE(1)							   User Commands							  WRITE(1)

write - send a message to another user SYNOPSIS
write user [ttyname] DESCRIPTION
Write 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. Some commands, for example nroff(1) and pr(1), may disallow writing automatically, so that your output isn't overwritten. 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 ter- minal 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), who(1) HISTORY
A write command appeared in Version 6 AT&T UNIX. AVAILABILITY
The write command is part of the util-linux package and is available from util-linux March 1995 WRITE(1)
Man Page

15 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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

11. UNIX for Dummies Questions & Answers

Trigger execution of commands whenever number of file descriptors changes

Hi, I am a Unix Newbie :D. I want to write a program such a way that: Whenever number of filedescriptors opened by a process change, it should execute some commands (eg: write total number of FDs at that point of time to a file). I dont want to poll '/proc/<pid>/fd' at regular intervals... (3 Replies)
Discussion started by: poweruser
3 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

Remove leading and trailing spaces from a file

Hi, I am trying to remove leading and trailing spaces from a file using awk but somehow I have not been able to do it. Here is the data that I want to trim. 07/12/2017 15:55:00 |entinfdev |AD ping Time ms | .474| 1.41| .581|green |flat... (9 Replies)
Discussion started by: svajhala
9 Replies

15. Shell Programming and Scripting

Problem with PATH

Recently I lost a number of changes I made to a program when the SCO Unix system went down. The system "mail" suggested a "vi -r" option that took me back several days. To prevent this in the future, I am trying to create my own vi command: if then cp -p $1 $1.bak fi /usr/bin/vi $* if ... (5 Replies)
Discussion started by: wbport
5 Replies