problems trying to redirect output from a command

From: Charlton, Mark <Mark.Charlton_at_capgemini.co.uk>
Date: Thu, 29 Jun 2000 15:33:11 +0100

Hi,

I'm trying to write a script to startup TNG on an alphaserver.

The script needs to check that a command has run correctly. To do this I
want to grep the output.

The command if it runs correctly should appear as below

# enfcontrol 847
enfcontrol 847
Enfcontrol[847]: CA tapes will NOT be protected after Tape shutdown

To check it has run correctly I only need to grep for NOT. If it fails,
another message is displayed.

The problem is that if I redirect the output only the first line appears in
the redirected file. I think, but am not sure that the command interacts
with some other TNG stuff, and this causes the second line of text to be
sent directly to the shell/terminal, and NOT to standard output. Therefore
you can't redirect the data as standard output.

I've tried playing around with redirecting standard output, error, tee,
piping - all to no avail. I've tried using the script utility, which
actually works interactively, but actually requires a 'streams based
terminal' as stated in the man pages, and so doesn't work within a script.

Does anyone have any ideas, that's if what I've just posted makes any sense
to anyone?

many thanks

Mark
Received on Thu Jun 29 2000 - 14:34:45 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:40 NZDT