home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!spool.mu.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!cs.utexas.edu!asuvax!ncar!uchinews!ellis!epc1
- From: epc1@ellis.uchicago.edu (Merlin)
- Subject: getting status of mt operation
- Message-ID: <1992Dec16.230407.25093@midway.uchicago.edu>
- Sender: news@uchinews.uchicago.edu (News System)
- Reply-To: epc1@midway.uchicago.edu
- Organization: University of Chicago Computing Organizations
- Date: Wed, 16 Dec 1992 23:04:07 GMT
- Lines: 21
-
-
- I am attempting to determine whether I have come to an end of a tape
- in a shell script. Because dd asks for the insertion of another
- tape at the end, I am doing the following:
-
- if ((@ status = `mt -f /dev/nrmt0l fsf 1`) == 0) then
- `mt -f /dev/nrmt0l bsf 2`
- `mt -f /dev/nrmt0l fsf 1`
- `dd if=/dev/nrmt0l bs=20b of=$argv[1]`
- else
- echo "done"
- endif
-
- However, at the end of the tape, I just get the following message:
- /dev/nrmt0l fsf 1 failed: I/O error
-
- In addition status does not return 2! I still get a 0 despite this error.
-
- WHAT can I do???
- Anybody have a solution???
-
-