home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / shell / 5098 < prev    next >
Encoding:
Text File  |  1992-12-16  |  1.1 KB  |  33 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!spool.mu.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!cs.utexas.edu!asuvax!ncar!uchinews!ellis!epc1
  3. From: epc1@ellis.uchicago.edu (Merlin)
  4. Subject: getting status of mt operation
  5. Message-ID: <1992Dec16.230407.25093@midway.uchicago.edu>
  6. Sender: news@uchinews.uchicago.edu (News System)
  7. Reply-To: epc1@midway.uchicago.edu
  8. Organization: University of Chicago Computing Organizations
  9. Date: Wed, 16 Dec 1992 23:04:07 GMT
  10. Lines: 21
  11.  
  12.  
  13. I am attempting to determine whether I have come to an end of a tape
  14. in a shell script.  Because dd asks for the insertion of another
  15. tape at the end, I am doing the following:
  16.  
  17.      if ((@ status = `mt -f /dev/nrmt0l fsf 1`) == 0) then
  18.        `mt -f /dev/nrmt0l bsf 2`
  19.        `mt -f /dev/nrmt0l fsf 1`
  20.        `dd if=/dev/nrmt0l bs=20b of=$argv[1]`
  21.      else 
  22.     echo "done"
  23.      endif
  24.  
  25. However, at the end of the tape, I just get the following message:
  26.   /dev/nrmt0l fsf 1 failed: I/O error
  27.  
  28. In addition status does not return 2!  I still get a 0 despite this error.
  29.  
  30. WHAT can I do???
  31. Anybody have a solution???
  32.  
  33.