home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!haven.umd.edu!news.umbc.edu!math13.math.umbc.edu!rouben
- From: rouben@math13.math.umbc.edu (Rouben Rostamian)
- Newsgroups: comp.unix.questions
- Subject: Re: need script to rename uppercase filenames
- Message-ID: <1992Sep3.120607.25089@umbc3.umbc.edu>
- Date: 3 Sep 92 12:06:07 GMT
- References: <699@svcs1.UUCP> <1992Sep3.083107.11920@athena.mit.edu>
- Sender: newspost@umbc3.umbc.edu (News posting account)
- Organization: University of Maryland Baltimore Campus, Academic Computing Services
- Lines: 30
-
- In article <1992Sep3.083107.11920@athena.mit.edu> benjy@athena.mit.edu (Benjamin B Thomas) writes:
- >In article <699@svcs1.UUCP> slix@svcs1.UUCP (Bill Miller) writes:
- >>
- >>I have some source code in DOS (many separate files) that I tarred under
- >>DOS and untarred under 386BSD. The big problem is that all the files
- >>came through in UPPERCASE and I need a script to mv (rename) them all
- >>to lowercase quickly.
- >
- >Try:
- >
- >#!/bin/csh
- >foreach i ($argv)
- >setenv file $i
- >cat $file | tr -d '\015' > `echo foo | nawk '{print tolower(ENVIRON["file"])}'`
- >rm $file
- >end
-
- I would suggest the quicker script:
-
- #!/bin/sh
- for file in *[A-Z]*
- do
- mv $file `echo $file | tr '[A-Z]' '[a-z]'`
- done
-
- This script changes all files names containing an uppercase letter
- in the current directory to lowercase. I would not strip the \015s
- so casually without knowing the contents of the files.
-
- --RR
-