home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!mcsun!sunic!ericom!eos.ericsson.se!etxmesa
- From: etxmesa@eos.ericsson.se (Michael Salmon)
- Subject: Re: need script to rename uppercase filenames
- Message-ID: <1992Sep4.064613.3378@ericsson.se>
- Keywords: script,tar,msdos
- Sender: news@ericsson.se
- Nntp-Posting-Host: eos6c02.ericsson.se
- Reply-To: etxmesa@eos.ericsson.se (Michael Salmon)
- Organization: Ericsson Telecom AB
- References: <699@svcs1.UUCP>
- Date: Fri, 4 Sep 1992 06:46:13 GMT
- Lines: 39
-
- In article <699@svcs1.UUCP>, slix@svcs1.UUCP (Bill Miller) writes:
- |> Hi, everyone.
- |>
- |> I'm fairly new to unix, and I need a script or procedure to do the following:
- |>
- |> 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.
- |>
- |> Since they're in DOS text format, I realize I also need to strip the
- |> extra carriage returns on each line. I've been successful in doing this
- |> with:
- |>
- |> cat (file) | tr -d '\015' > (newfile)
- |>
- |> It would be nice to combine both of these so that I could rename the
- |> files to uppercase and strip the extra newlines all in one fell swoop
- |> instead of doing it one file at a time.
- |>
-
- A little plug for tcsh:
-
- foreach fn ([A-Z]*)
- tr -d '\015' <$fn >$fn:al
- end
-
- Of course the original file name specification is a little simplistic.
-
- --
-
- Michael Salmon
-
- #include <standard.disclaimer>
- #include <witty.saying>
- #include <fancy.pseudo.graphics>
-
- Ericsson Telecom AB
- Stockholm
-