Need a file renaming facility

Rob McMahon cudcv at daisy.warwick.ac.uk
Wed May 11 06:17:02 AEST 1988


In article <784 at stride.Stride.COM> ctr at xpiinc.uu.net (Christian Reimer) writes:
>In article <3564 at fluke.COM> inc at tc.fluke.COM (Gary Benson) writes:
>>Now I want to rename all those ".pre" files to the same name without ".pre".
>
>Try:
>	foo% foreach i ( `ls *.pre | sed 's/.pre$//'` )
>	? echo "Moving ${i}..."
>	? mv ${i}.pre $i
>	? end

Or even

	foo% foreach i ( *.pre )
	? echo "Moving ${i}..."
	? mv $i $i:r
	? end

Rob
-- 
UUCP:   ...!mcvax!ukc!warwick!cudcv	PHONE:  +44 203 523037
JANET:  cudcv at uk.ac.warwick.cu          ARPA:   cudcv at cu.warwick.ac.uk
Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England



More information about the Comp.unix.questions mailing list