Документ взят из кэша поисковой машины. Адрес оригинального документа : http://comet.sai.msu.ru/UNIXhelp/scrpt/scrpt2.4.3.1.html
Дата изменения: Fri Jan 17 12:43:20 1997
Дата индексирования: Tue Oct 2 02:04:34 2012
Кодировка:
Example of using the || operator

Example of using the || operator

To send a message to a user using the appropriate utility:

   cat writemail
   #!/bin/sh
   # usage: writemail user message
   echo "$2" |{ write "$1" || mail "$1" ;} 

The user types a command such as:

   writemail sarah 'call me'

The message entered by the user is piped through the command { write "$1" || mail "$1" ; }.

If the the message cannot be sent to the user's terminal (they are not logged on) with the command write "$1" then the message is sent to the user by mail.


[Home] [Search] [Index]