This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

How to automatically process file/dir names?


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]