Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!gatech!hao!woods From: woods@hao.UCAR.EDU (Greg Woods) Newsgroups: comp.unix.questions Subject: Re: Renaming groups of files Message-ID: <719@hao.UCAR.EDU> Date: Fri, 5-Jun-87 16:43:14 EDT Article-I.D.: hao.719 Posted: Fri Jun 5 16:43:14 1987 Date-Received: Wed, 10-Jun-87 00:42:15 EDT References: <2271@calmasd.GE.COM> Distribution: world Organization: High Altitude Obs./NCAR, Boulder CO Lines: 25 Summary: Quick-and-dirty C-shell method In article <2271@calmasd.GE.COM> jmm@calmasd.UUCP (James Moore) writes: >What's the best way to go about renaming groups of files >like: > >a.a a.b a.c a.d > >To: > >b.a b.b b.c b.d You can take advantage of the dot being there if you are a C-shell user (there might be a similar trick in the Bourne shell, I don't know). foreach f (a.*) mv $f b.$f:e end The :e modifier on a variable substitution takes the "extension", i.e. the part after the last dot. --Greg -- UUCP: {hplabs, seismo, nbires, noao}!hao!woods CSNET: woods@ncar.csnet ARPA: woods%ncar@CSNET-RELAY.ARPA INTERNET: woods@hao.ucar.edu