home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / question / 13028 < prev    next >
Encoding:
Text File  |  1992-11-07  |  1.1 KB  |  42 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!mojo.eng.umd.edu!lind
  3. From: lind@eng.umd.edu (Charles A. Lind)
  4. Subject: Re: recursive renaming down directory tree.  How?
  5. Message-ID: <1992Nov06.132937.22357@eng.umd.edu>
  6. Date: Fri, 06 Nov 92 13:29:37 GMT
  7. Organization: College of Engineering, Maryversity von Uniland, College Park
  8. References:  <1992Nov6.044055.18206@cs.ucla.edu>
  9. Originator: lind@valkyrie.eng.umd.edu
  10. Lines: 30
  11.  
  12.  
  13. In article <1992Nov6.044055.18206@cs.ucla.edu>, thanospa@oahu.cs.ucla.edu (Athanassios Papadimitriou) writes:
  14. >Hi;
  15. >
  16. >    Probably many of you will know the answer, but I don't; please
  17. >help:
  18. >
  19. >    I have a bunch of files with a .cc suffix and I want to change
  20. >the suffix to .C.   Is there any clever way of doing it rather than
  21. >manually change every one of them?  I kind of know 'find' will help
  22. >do the trick though.
  23. >    Thanks.
  24. >
  25. >        Thanos
  26.  
  27.  
  28. Thanos, 
  29.     Try this:
  30.  
  31. #!/bin/csh
  32. foreach file (`ls *.cc`)
  33.         set newfile = $file:r.C
  34.         cp $file $newfile
  35.         echo "moved $file to $newfile"
  36. end
  37.  
  38.  
  39. Charles
  40. lind@eng.umd.edu
  41.