Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/3/84; site panda.UUCP Path: utzoo!decvax!linus!philabs!cmcl2!harvard!talcott!panda!sources-request From: sources-request@panda.UUCP Newsgroups: mod.sources Subject: rename: a companion to restor Message-ID: <1067@panda.UUCP> Date: Tue, 5-Nov-85 09:28:02 EST Article-I.D.: panda.1067 Posted: Tue Nov 5 09:28:02 1985 Date-Received: Thu, 7-Nov-85 03:19:09 EST Sender: jpn@panda.UUCP Lines: 45 Approved: jpn@panda.UUCP Mod.sources: Volume 3, Issue 36 Submitted by: genrad!amd!amdcad!phil (Phil Ngai) This is a shell script, not a shell archive. #! /bin/sh # "rename" shell script # by Phil Ngai, 11/4/85 # Moves files after V7 or Xenix style restor has left you with a # set of files with numeric names. It makes intermediate directories. # To use, first get a list of inodes and final pathname from dumpdir, # then edit out the names you don't want. In the top level directory, # feed the remaining lines to this script and feed its output to sh. # Sample expected input: # 11 /lib/uucp/dial.c # 13 /lib/tabset/3101 # 30 /lib/atrun # 103 /lib/uucp/L.sys # Sample output: # mkdir ./lib # mkdir ./lib/uucp # mv 103 /lib/uucp/L.sys # mv 11 /lib/uucp/dial.c # mv 13 /lib/tabset/3101 # mv 30 /lib/atrun while read in do set `echo $in` INODE=$1 PATHNAME=$2 FINALNAME=$PATHNAME OIFS=$IFS IFS=/ set $PATHNAME IFS=$OIFS DIR=. while expr $# '>=' 2 > /dev/null do DIR=$DIR/$1 echo mkdir $DIR shift done echo mv $INODE .$FINALNAME done \ | sort | uniq