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

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!mcsun!sunic!ericom!eos.ericsson.se!etxmesa
  3. From: etxmesa@eos.ericsson.se (Michael Salmon)
  4. Subject: Re: need script to rename uppercase filenames
  5. Message-ID: <1992Sep4.064613.3378@ericsson.se>
  6. Keywords: script,tar,msdos
  7. Sender: news@ericsson.se
  8. Nntp-Posting-Host: eos6c02.ericsson.se
  9. Reply-To: etxmesa@eos.ericsson.se (Michael Salmon)
  10. Organization: Ericsson Telecom AB
  11. References:  <699@svcs1.UUCP>
  12. Date: Fri, 4 Sep 1992 06:46:13 GMT
  13. Lines: 39
  14.  
  15. In article <699@svcs1.UUCP>, slix@svcs1.UUCP (Bill Miller) writes:
  16. |> Hi, everyone.
  17. |> 
  18. |> I'm fairly new to unix, and I need a script or procedure to do the following:
  19. |>  
  20. |> I have some source code in DOS (many separate files) that I tarred under
  21. |> DOS and untarred under 386BSD.  The big problem is that all the files
  22. |> came through in UPPERCASE and I need a script to mv (rename) them all
  23. |> to lowercase quickly.
  24. |>  
  25. |> Since they're in DOS text format, I realize I also need to strip the 
  26. |> extra carriage returns on each line.  I've been successful in doing this
  27. |> with:
  28. |>  
  29. |>   cat (file) | tr -d '\015' > (newfile)
  30. |>  
  31. |> It would be nice to combine both of these so that I could rename the
  32. |> files to uppercase and strip the extra newlines all in one fell swoop
  33. |> instead of doing it one file at a time.
  34. |> 
  35.  
  36. A little plug for tcsh:
  37.  
  38. foreach fn ([A-Z]*)
  39.     tr -d '\015' <$fn >$fn:al
  40. end
  41.  
  42. Of course the original file name specification is a little simplistic.
  43.  
  44. -- 
  45.  
  46. Michael Salmon
  47.  
  48. #include    <standard.disclaimer>
  49. #include    <witty.saying>
  50. #include    <fancy.pseudo.graphics>
  51.  
  52. Ericsson Telecom AB
  53. Stockholm
  54.