Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!nrl-cmf!ukma!rutgers!ucsd!nosc!helios.ee.lbl.gov!pasteur!ames!pacbell!pbhyf!rob From: rob@pbhyf.PacBell.COM (Rob Bernardo) Newsgroups: comp.unix.wizards Subject: Re: simple question about mv Message-ID: <4601@pbhyf.PacBell.COM> Date: 27 Jan 89 22:45:19 GMT References: <18217@adm.BRL.MIL> Reply-To: rob@pbhyf.PacBell.COM (Rob Bernardo) Organization: Pacific * Bell, San Ramon, CA Lines: 29 In article <18217@adm.BRL.MIL> DEG41560@ua1vm.ua.edu (Rob Smith) writes: + I know this is simple, but then again, so am I. What if I want to mv a bunch +of files with the same suffix to another suffix. The following does not +work + + mv *.flip *.flop + +what does? I'm under Ultrix 2.2. I'm doing it by hand, but I'd like to +be able to do wild card renames, ala DOS. If you have ksh do this: for file in *.flip do mv $file ${file%%flip}flop done otherwise you could resort to using sed to generate the new file name, something like this (but pardon any typos): for file in *.flip do mv $file `echo $file | sed 's/flip$/flop/'` done -- Rob Bernardo, Pacific Bell UNIX/C Reusable Code Library Email: ...![backbone]!pacbell!pbhyf!rob OR rob@pbhyf.PacBell.COM Office: (415) 823-2417 Room 4E750A, San Ramon Valley Administrative Center Residence: (415) 827-4301 R Bar JB, Concord, California