home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2251 < prev    next >
Internet Message Format  |  1990-12-28  |  1KB

  1. From: pinard@IRO.UMontreal.CA (Francois Pinard)
  2. Newsgroups: alt.sources
  3. Subject: Re: Neat utility to convert uppercase filenames
  4. Message-ID: <PINARD.90Dec10184326@kovic.IRO.UMontreal.CA>
  5. Date: 10 Dec 90 23:43:26 GMT
  6.  
  7. In article <76@gdx.UUCP> jay@gdx.UUCP (Jay A. Snyder) writes:
  8.  
  9.    Did you ever do mget from simtel20 or ymodem batch downloads from
  10.    an MSDOS BBS, and get a lot of uppercase files in your directory?
  11.    Well this is a utility that will take all specified files and
  12.    convert them to lower case.
  13.  
  14. I use this:
  15.  
  16. #!/bin/sh
  17. # Convert upper case in file names to lower case.
  18. # Copyright (C) 1990 Free Software Foundation, Inc.
  19. # Francois Pinard <pinard@iro.umontreal.ca>, October 1990.
  20.  
  21. echo $* \
  22.     | tr " " "\012" \
  23.     | gawk '{ if ($1 != tolower($1)) { print "mv", $1, tolower($1) } }' \
  24.     | sh
  25.  
  26. I'm sure there is a one-liner in Perl to do the same :-).
  27. --
  28. Franc,ois Pinard          ``Vivement GNU!''         pinard@iro.umontreal.ca
  29. (514) 588-4656    cp 886 L'Epiphanie (Qc) J0K 1J0    ...!uunet!iros1!pinard
  30.