Re: UNIX question
Posted in 1998
Steve Romankiw wrote:
>
> As root, you can send messages to the console by typing "echo hello >
> /dev/console".
> When I try this as any user besides root, I get a message similar to
> "/dev/console: cannot create".
>
> As someone other than root, how would you do something like:
>
> <<snip>>
> example# sendtoconsole hello # send
> message to console
>
> example# cat sendtoconsole
> echo $1 > /dev/console
Have a look at the write command. Although it is user based, you can
probably assume that root is logged into the console. The write command
takes the user AND an optional terminal name as parameters.
Hope that helps,
--
Mark.
+----------------------------------------------------------+-----------+
|Mark D. Stock - Informix SA http://www.informix.com |//////// /|
|mailto:mdstock@informix.com FAQ http://www.iiug.org |///// / //|
| +-----------------------------------+//// / ///|
| Tel: +27 11 807 0313 |If it's slow, the users complain. |/// / ////|
| Fax: +27 11 807 2594 |If it's fast, the users keep quiet.|// / /////|
|Cell: +27 83 250 2325 |Therefore, "No news: travels fast"!|/ ////////|
+----------------------+-----------------------------------+-----------+