delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/01/18/06:03:06

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
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

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019