Intercept *ALL* messages to shell?

Intercept *ALL* messages to shell?

Post by Phil Peruc » Thu, 06 Jan 1994 22:01:18



Does anyone know of a way to intercept ALL messages sent to a shell,
for example messages (msg command) sent from other users and messages
coming from daemons?

The tape mount command on my SVR3.1 system ('tape') returns after the
mount request is queued --- I need to wait for a "tape ready" message
before proceeding in my scripts.

Any pointers would be greatly appreciated.  I have access to most of the
standard Unix & C/C++ programming books and docs, but don't know what
"buzzwords" to look up.
--
==============================================================================
 Phil Perucci             | "All postings are my own opinion - all comments
 Systems Programmer       |  are intended for research/educational purposes"
==============================================================================

 
 
 

Intercept *ALL* messages to shell?

Post by Fco. J. Ballester » Thu, 06 Jan 1994 22:34:51



>   Does anyone know of a way to intercept ALL messages sent to a shell,
>   for example messages (msg command) sent from other users and messages
>   coming from daemons?

   You need a way to intercept messages written to the tty (!) the
shell is attached to.

Quote:>   The tape mount command on my SVR3.1 system ('tape') returns after the
>   mount request is queued --- I need to wait for a "tape ready" message
>   before proceeding in my scripts.

   just do
     $  your-dump-command 2>&1 | use-awk-to-process-"tape ready"-lines
   The awk script should echo the stdin also if you wanna do.

Hope this helps.
--

                _==|                +------------------------------+  
           _==|   )__)  |           |  Francisco J. Ballesteros    |  

Pirate!     )___) )____))_)         +------------------------------+  
       _    )____)_____))__)\                                              
        \---__|____/|___|___-\\---
^^^^^^^^^\   oo oo oo oo     /~~^^^^^^^
  ~^^^^ ~~~~^^~~~~^^~~^^~~~~~
    ~~^^      ~^^~     ~^~ ~^ ~^
         ~^~~        ~~~^^~
(Guarning: Not a computer pirate!)
(Guarning: Guarning's not Warning!)

 
 
 

Intercept *ALL* messages to shell?

Post by Fco. J. Ballester » Thu, 06 Jan 1994 22:43:50



Quote:

>   >   The tape mount command on my SVR3.1 system ('tape') returns after the
>   >   mount request is queued --- I need to wait for a "tape ready" message
>   >   before proceeding in my scripts.

>      just do
>    $  your-dump-command 2>&1 | use-awk-to-process-"tape ready"-lines
>      The awk script should echo the stdin also if you wanna do.

        OOooooppppsss!!!

        sorry4themess!, if the tape command mounts only a tape
        simply: (or check for return codes).

     $tape && rest-of-commands

        if it mounts more than one tape (I don't know) then use the
previous post approach

--

                _==|                +------------------------------+  
           _==|   )__)  |           |  Francisco J. Ballesteros    |  

Pirate!     )___) )____))_)         +------------------------------+  
       _    )____)_____))__)\                                              
        \---__|____/|___|___-\\---
^^^^^^^^^\   oo oo oo oo     /~~^^^^^^^
  ~^^^^ ~~~~^^~~~~^^~~^^~~~~~
    ~~^^      ~^^~     ~^~ ~^ ~^
         ~^~~        ~~~^^~
(Guarning: Not a computer pirate!)
(Guarning: Guarning's not Warning!)

 
 
 

Intercept *ALL* messages to shell?

Post by Phil Peruc » Thu, 06 Jan 1994 23:41:55





>>   >   The tape mount command on my SVR3.1 system ('tape') returns after the
>>   >   mount request is queued --- I need to wait for a "tape ready" message
>>   >   before proceeding in my scripts.

>>      just do
>>        $  your-dump-command 2>&1 | use-awk-to-process-"tape ready"-lines
>>      The awk script should echo the stdin also if you wanna do.

But "your-dump-command" does not issue the messages I am trying to capture.
The "your-dump-command" command queues a request to the tape daemon.
The message comes from the tape daemon, after the tape is mounted.
The "your-dump-command" return immediately, with no output to
stdout or stderr.

Quote:

>    OOooooppppsss!!!

>    sorry4themess!, if the tape command mounts only a tape
>        simply: (or check for return codes).

>     $tape && rest-of-commands

Is "&&" different from '&'?

--
==============================================================================
 Phil Perucci             | "All postings are my own opinion - all comments
 Systems Programmer       |  are intended for research/educational purposes"
==============================================================================

 
 
 

Intercept *ALL* messages to shell?

Post by Jeremy Mathe » Fri, 07 Jan 1994 00:30:36



>Does anyone know of a way to intercept ALL messages sent to a shell,
>for example messages (msg command) sent from other users and messages
>coming from daemons?
...
>Any pointers would be greatly appreciated.  I have access to most of the
>standard Unix & C/C++ programming books and docs, but don't know what
>"buzzwords" to look up.

I Expect the answer to this one is pretty obvious from this posting.

Half the volume would go away if they knew how to read man pages.

The other half would go away if they knew about Expect.

************************************************************************
People who have what they want are very fond of telling people who
haven't what they want that they don't want it.
                -- Ogden Nash


          hundreds, if not thousands, of dollars, every time he posts -
************************************************************************
rwvpf wpnrrj ibf ijrfer