Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!mips!twg.com!david From: david@twg.com (David S. Herron) Newsgroups: comp.sys.amiga.tech Subject: Re: PIPEs Message-ID: <8292@gollum.twg.com> Date: 16 Nov 90 04:02:44 GMT References: <6984@sugar.hackercorp.com> <1990Nov4.215000.2760@opusc.csd.scarolina.edu> <6997@sugar.hackercorp.com> <1990Nov7.235254.13959@opusc.csd.scarolina.edu> <7025@sugar.hackercorp.com> Reply-To: david@twg.com (David S. Herron) Organization: The Wollongong Group, Palo Alto, CA Lines: 37 In article <7025@sugar.hackercorp.com> peter@sugar.hackercorp.com (Peter da Silva) writes: >> +For things like "move", I'd rather go to slices: > >> + move {.*}.c \1.h > >In article <1990Nov7.235254.13959@opusc.csd.scarolina.edu> yarnall@opusc.csd.scarolina.edu (Ken Yarnall) writes: >> Yeah, right. That is much clearer...:-) > >OK, quick. How do you rename all whatever.c-or-h files to old.whatever.c-or-h >with wildcards instead of slices? Easy: for f in *.[ch]; do mv $f old.$f done CLUNK! Now changing the `extension' like your example above is harder: for f in *.[ch]; do mv $f `echo $f | sed 's/^\([^\.]*\)\.c$/\1.h/'` done CLUNK CLUNK! And if you like visual feedback add a "echo $f" in there. It may look ugly but at least it's succint ;-)... -- <- David Herron, an MMDF & WIN/MHS guy, <- Formerly: David Herron -- NonResident E-Mail Hack <- <- Use the force Wes!