The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

Поиск:  Каталог документации

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]



Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру