Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!bionet!ames!sun-barr!cs.utexas.edu!uunet!zephyr.ens.tek.com!tekgen!puffin!penguin!richl From: richl@penguin.USS.TEK.COM (Rick Lindsley) Newsgroups: comp.unix.wizards Subject: Re: validating dumps Message-ID: <454@puffin.uss.tek.com> Date: 21 Aug 89 22:18:36 GMT References: <794@Terra.cc.brunel.ac.uk> Sender: news@puffin.uss.tek.com Reply-To: richl@penguin.USS.TEK.COM (Rick Lindsley) Organization: Tektronix, Inc., Beaverton, OR. Lines: 21 In article <794@Terra.cc.brunel.ac.uk> linda@cc.brunel.ac.uk (Linda Birmingham) writes: I'm trying to validate dump tapes. I liked someones idea of trying to restore the last file on the tape. The question was...how do I know which is the last file. restore tv will print out things like dir 2 . dir 1536 ./etc leaf 1630 ./etc/dumpdates A "dir" is obvious; a "leaf" is really just "not-dir". A simple awk script will then help you here: restore tv | awk '$1 == "leaf" {if (ino < $2) file = $3;} END {print file}' This fails if that last filename has white space in it. Rick