Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!amdcad!sun!pitstop!sundc!seismo!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: simple question about mv Message-ID: <906@auspex.UUCP> Date: 28 Jan 89 06:09:34 GMT References: <18231@adm.BRL.MIL> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 14 >Well, this should work under a Bourne shell: >$ for i in *.flip >> do mv $i `basename $i .flip` .flop ... Assuming, of course, that all the files are in the current directory, since "basename" will not only strip off the ".flip", but will also strip off all the directories leading up to the name (i.e., it will turn "/usr/src/nemo/cigar.flip" into "cigar", not into "/usr/src/nemo/cigar"). If your system has "dirname", which will strip off the last component of the name and give you the directory in question, you can use that if need be.