home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!stanford.edu!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!benjy
- From: benjy@athena.mit.edu (Benjamin B Thomas)
- Subject: Re: need script to rename uppercase filenames
- Message-ID: <1992Sep3.083107.11920@athena.mit.edu>
- Sender: news@athena.mit.edu (News system)
- Nntp-Posting-Host: e40-008-4.mit.edu
- Organization: Massachvsetts Institvte of Technology
- References: <699@svcs1.UUCP>
- Date: Thu, 3 Sep 1992 08:31:07 GMT
- Lines: 21
-
- 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
-
-
- Now just type the script name and the filenames (or partial filenames
- with wildcards) and you should be set.
-
- -Benjy
-