home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / question / 10680 < prev    next >
Encoding:
Text File  |  1992-09-02  |  1.0 KB  |  34 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!stanford.edu!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!benjy
  3. From: benjy@athena.mit.edu (Benjamin B Thomas)
  4. Subject: Re: need script to rename uppercase filenames
  5. Message-ID: <1992Sep3.083107.11920@athena.mit.edu>
  6. Sender: news@athena.mit.edu (News system)
  7. Nntp-Posting-Host: e40-008-4.mit.edu
  8. Organization: Massachvsetts Institvte of Technology
  9. References: <699@svcs1.UUCP>
  10. Date: Thu, 3 Sep 1992 08:31:07 GMT
  11. Lines: 21
  12.  
  13. In article <699@svcs1.UUCP> slix@svcs1.UUCP (Bill Miller) writes:
  14. >I have some source code in DOS (many separate files) that I tarred under
  15. >DOS and untarred under 386BSD.  The big problem is that all the files
  16. >came through in UPPERCASE and I need a script to mv (rename) them all
  17. >to lowercase quickly.
  18.  
  19. Try:
  20.  
  21. #!/bin/csh 
  22. foreach i ($argv)
  23. setenv file $i
  24. cat $file | tr -d '\015' > `echo foo | nawk '{print tolower(ENVIRON["file"])}'`
  25. rm $file
  26. end
  27.  
  28.  
  29.      Now just type the script name and the filenames (or partial filenames 
  30. with wildcards) and you should be set. 
  31.  
  32.                     -Benjy
  33.