Neat utility to convert uppercase filenames

Francois Pinard pinard at IRO.UMontreal.CA
Tue Dec 11 10:43:26 AEST 1990


In article <76 at gdx.UUCP> jay at gdx.UUCP (Jay A. Snyder) writes:

   Did you ever do mget from simtel20 or ymodem batch downloads from
   an MSDOS BBS, and get a lot of uppercase files in your directory?
   Well this is a utility that will take all specified files and
   convert them to lower case.

I use this:

#!/bin/sh
# Convert upper case in file names to lower case.
# Copyright (C) 1990 Free Software Foundation, Inc.
# Francois Pinard <pinard at iro.umontreal.ca>, October 1990.

echo $* \
	| tr " " "\012" \
	| gawk '{ if ($1 != tolower($1)) { print "mv", $1, tolower($1) } }' \
	| sh

I'm sure there is a one-liner in Perl to do the same :-).
--
Franc,ois Pinard          ``Vivement GNU!''         pinard at iro.umontreal.ca
(514) 588-4656    cp 886 L'Epiphanie (Qc) J0K 1J0    ...!uunet!iros1!pinard



More information about the Alt.sources mailing list