From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ns1.sunset.net ([205.161.255.5] helo=onyx.sunset.net) by speech.braille.uwo.ca with esmtp (Exim 3.36 #1 (Debian)) id 1HsKDh-00013N-00 for ; Sun, 27 May 2007 10:59:45 -0400 Received: from sunset.net (198-69-252-82.chico.ca.digitalpath.net [198.69.252.82]) by onyx.sunset.net (8.12.11.20060308/8.12.10) with ESMTP id l4REtgSB019985 for ; Sun, 27 May 2007 07:55:42 -0700 Received: (from rreid@localhost) by sunset.net (8.13.8/8.13.8/Submit) id l4RExa5C004468 for speakup@braille.uwo.ca; Sun, 27 May 2007 07:59:36 -0700 Date: Sun, 27 May 2007 07:59:36 -0700 From: "Ralph W. Reid" To: "Speakup is a screen review system for Linux." Subject: Re: windows files to linux? Message-ID: <20070527145936.GA2873@sunset.net> References: <000e01c79fb3$30954600$6800a8c0@vickiexp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000e01c79fb3$30954600$6800a8c0@vickiexp> User-Agent: Mutt/1.4.2.2i X-src-ip: 198.69.252.82 X-BeenThere: speakup@braille.uwo.ca X-Mailman-Version: 2.1.9 Precedence: list Reply-To: "Speakup is a screen review system for Linux." List-Id: "Speakup is a screen review system for Linux." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 May 2007 14:59:45 -0000 My choice would be to replace the spaces with underline characters. However, you indicated that you wanted space characters to be replaced with ' _ ' strings--to each his own, I guess. This little script should do what you want (I hope). Use at your own risk. #!/bin/bash #win2lin.sh #converts Windblows file names to Linux file names #Spaces in file names are translated to ' _ ' #upper case letters in file names are converted to lower case #This script only performs conversions in the current directory--no #directory tree traversal is provided. #Use this script at your own risk. function win2lin_func { for i in * do newname=`echo $i | tr [A-Z] [a-z] | sed "s/ / _ /g"` if [ "$newname" != "$i" ]; then echo Renaming \"$i\" to \"$newname\" mv -i "$i" "$newname" fi done } #mainline code #check for a single command line parameter if [ "$#" != "1" ]; then echo Usage $0: echo $0 param/ echo where param is the directory where files are to be renamed echo "(be sure to include the trailing /)." exit 1 fi #process the file names win2lin_func #end of win2lin script HTH, and have a _great_ day! On Sat, May 26, 2007 at 10:30:34AM -0600, TheCreator wrote: > Hello list, > I've got a ton of files that have half capital letters, etc etc. > I was wondering if there was a program that would go through and make my file names lowercase, (only on a selected folder), and put an _ between the spaces. > Thanks, > ~~TheCreator~~ -- Ralph. N6BNO. Wisdom comes from central processing, not from I/O. rreid@sunset.net http://personalweb.sunset.net/~rreid ...passing through The City of Internet at the speed of light... _PI = 4 * ARCTAN (1)