rename(3): program to modify a set f - (nf)

mdoerr at uklirb.UUCP mdoerr at uklirb.UUCP
Mon Mar 9 22:24:00 AEST 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



More information about the Comp.sources.unix mailing list