home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!mojo.eng.umd.edu!lind
- From: lind@eng.umd.edu (Charles A. Lind)
- Subject: Re: recursive renaming down directory tree. How?
- Message-ID: <1992Nov06.132937.22357@eng.umd.edu>
- Date: Fri, 06 Nov 92 13:29:37 GMT
- Organization: College of Engineering, Maryversity von Uniland, College Park
- References: <1992Nov6.044055.18206@cs.ucla.edu>
- Originator: lind@valkyrie.eng.umd.edu
- Lines: 30
-
-
- In article <1992Nov6.044055.18206@cs.ucla.edu>, thanospa@oahu.cs.ucla.edu (Athanassios Papadimitriou) writes:
- >Hi;
- >
- > Probably many of you will know the answer, but I don't; please
- >help:
- >
- > I have a bunch of files with a .cc suffix and I want to change
- >the suffix to .C. Is there any clever way of doing it rather than
- >manually change every one of them? I kind of know 'find' will help
- >do the trick though.
- >
- > Thanks.
- >
- > Thanos
-
-
- Thanos,
- Try this:
-
- #!/bin/csh
- foreach file (`ls *.cc`)
- set newfile = $file:r.C
- cp $file $newfile
- echo "moved $file to $newfile"
- end
-
-
- Charles
- lind@eng.umd.edu
-