mt status option

Len Zaifman LEONARDZ at VM.UOGUELPH.CA
Thu Dec 13 10:31:25 AEST 1990


On Tue, 11 Dec 90 14:52:27 EST you said:
>Hi everyone,
>	I'm trying to write a shell script in which I need to find
>out if the 8mm tape is in the drive.  Whenever I execute the
>mt command with the status option, the output always appears at
>my terminal, regardless of whether its output is redirected or piped,
>or even if it's in a shell script on the right side of an equal sign.
>Does anyone know how this output can be redirected so that I can
>capture the 'status' information?  I tried
>
>	mt -t /dev/mt/tps0d6 status > dum
>
>	mt -t /dev/mt/tps0d6 status | grep Status
>
>	and in a shell script:
>
>	xxx=`mt -t /dev/mt/tps0d6 status`
>
>All of the above display the output at my terminal.  Thanks
>in advance.

   In csh use >& to redirect the stderr output to a file :

   See example below :

< 24 nic.uoguelph.ca /cs/leonardz> mt -t /dev/nrxb status
Controller: SCSI                                        |  This
Device: EXABYTE: EXB-8200        425A                   |  appears
Status: 0x200                                           |  on
Media : Not READY                                       |  terminal
< 25 nic.uoguelph.ca /cs/leonardz> mt -t /dev/nrxb status >& mystat
< 26 nic.uoguelph.ca /cs/leonardz> cat mystat
Controller: SCSI
Device: EXABYTE: EXB-8200        425A
Status: 0x200
Media : Not READY
< 27 nic.uoguelph.ca /cs/leonardz>


>
>kcables at relay.nswc.navy.mil

                                                         Regards, Len Zaifman

Len Zaifman
Information Technology Coordinator,College of Physical and Engineering Science
Department of Computing Services
University of Guelph
Guelph,Ontario.  N1G 2W1
(519)821-4120 xt 6566
email : LeonardZ at VM.UOGUELPH.CA



More information about the Comp.sys.sgi mailing list