Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!mcdchg!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: comp.unix.questions Subject: Re: simple question about mv Message-ID: <7558@chinet.chi.il.us> Date: 28 Jan 89 05:03:48 GMT References: <18216@adm.BRL.MIL> Reply-To: les@chinet.chi.il.us (Leslie Mikesell) Organization: Chinet - Public Access Unix Lines: 26 In article <18216@adm.BRL.MIL> DEG41560@ua1vm.ua.edu (Rob Smith) writes: >HI, > 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. Unlike DOS file extensions, the '.' is just another character to unix. How about: (using /bin/sh) for i in *.flip do mv $i `sed -e 's/flip$/flop'` done It might be easier to arrange to have flip and flop subdirectories instead of using the file suffix since it is a bit easier to: mv flip/* flop and generally no more difficult to construct the full pathname. Les Mikesell