Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uakari.primate.wisc.edu!sdd.hp.com!elroy.jpl.nasa.gov!aero!aerospace.aero.org!lmiller From: lmiller@aerospace.aero.org (Lawrence H. Miller) Newsgroups: comp.unix.shell Subject: Re: How to do mv *.xyz *.abc in shell script?? Message-ID: <84985@aerospace.AERO.ORG> Date: 7 Sep 90 16:52:37 GMT References: <5569@minyos.xx.rmit.oz> <975@ria.ccs.uwo.ca> Sender: news@aerospace.aero.org Reply-To: lmiller@armadillo.UUCP (Lawrence H. Miller) Organization: The Aerospace Corporation, El-Segundo, CA Lines: 19 One way to do this is to use basename. Try something like this (for you specific case of changing *.xyz to *.abc). (This is a Bourne shell script.) ------------------------------ CUT HERE ------------------------------ for i in *.xyz do a=`basename $i .xyz` echo moving $a.xyz to $a.abc mv $a.xyz $a.abc done Larry Miller Aerospace Corporation lmiller@aerospace.aero.org 213-336-5597