Path: utzoo!utgpu!watserv1!watmath!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!wuarchive!uunet!world!kaspar!ires From: ires@kaspar.UUCP (Bruce R. Larson) Newsgroups: comp.unix.sysv386 Subject: portable `rewind' for tape devices Keywords: tape, dd, FAQ Message-ID: <19@kaspar.UUCP> Date: 29 Nov 90 02:13:56 GMT Organization: Integral Resources Lines: 34 I've been looking for a portable `rewind' to use in shell scripts, and I may have found (or more likely, reinvented) the perfect solution. I am posting this because it answers the rewind question raised in FAQ #5. Here are a couple of Bourne shell functions to i) rewind the tape device, and ii) advance to the next archive on the tape. TAPE=dev/tape NTAPE=/dev/ntape rewind_tape(){ dd if=$TAPE of=/dev/null count=0 2>/dev/null } advance_tape(){ dd if=$NTAPE of=/dev/null count=0 2>/dev/null } It works for me! Bruce Bruce R. Larson | The drug problem in the US is so Integral Resources, Milton MA | vast that we need to recognize that Internet: ires.com!blarson@cs.umb.edu | it is primarily a social problem, Uucp: ..!cs.umb.edu!ires.com!blarson| not a criminal problem. --