Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Sat, 18 Jan 2003 12:02:50 +0100 (MET) From: svartsjel AT gmx DOT net To: cygwin AT cygwin DOT com MIME-Version: 1.0 Subject: How to automatically process file/dir names? X-Priority: 3 (Normal) X-Authenticated-Sender: #0000624634 AT gmx DOT net X-Authenticated-IP: [172.177.123.8] Message-ID: <7705.1042887770@www33.gmx.net> X-Flags: 0001 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Hi, Quite a few problems arise from within self-written scripts when dealing with (Windows') file and directory names containing spaces. I therefore thought about a script which takes a directory as argument, recursively processing both file and (sub)dir names in it (starting with the argument's name itself), replacing each space with an underscore (additionally also rendering everything lowercase), and cutting off trailing space(s) from names, respectively. For instance, the processed files fortunes-o_, index_2.htm_ and index2_.html should be detected and fixed like this: fortunes-o, index_2.htm, index2.html. How would you accomplish that? Many thanks in advance, and best wishes! svartsjel -- +++ GMX - Mail, Messaging & more http://www.gmx.net +++ NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen! -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/