Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcvax!unido!uklirb!mdoerr From: mdoerr@uklirb.UUCP Newsgroups: net.sources Subject: Re: rename(3): program to modify a set f - (nf) Message-ID: <27300001@uklirb.UUCP> Date: Mon, 9-Mar-87 07:24:00 EST Article-I.D.: uklirb.27300001 Posted: Mon Mar 9 07:24:00 1987 Date-Received: Tue, 10-Mar-87 18:39:26 EST References: <486@myrias.UUCP> Lines: 24 Nf-ID: #R:myrias:-48600:uklirb:27300001:000:675 Nf-From: uklirb!mdoerr Mar 9 13:24:00 1987 I happen to use the following shell script for the same purpose: ---------- Cut here ! ----------- #!/bin/csh # # rename: Globally rename a set of files with a common substring # into a set of files with another common substring # # example: Suppose you have the files # info-atari16.digest.01 ... info-atari16.digest.30 # and want to rename these files to # dgstia16.001 ... dgstia16.030. # Then issue the command # rename '*digest*' 'info-atari16\.digest\.' 'dgstia16\.0' # and your job is done. # foreach index ( $1 ) mv $index `ls $index | sed s/$2/$3/` end --------- Cut again ! ---------- Michael Doerr, Uni. of Kaiserlautern ...!seismo!unido!uklirb!mdoerr