LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Script junkies

[ILUG] Script junkies

Fergal Daly fergal at esatclear.ie
Tue Apr 10 21:47:40 IST 2001


do a

mkdir -p ABC/abc/ABC

and stick an echo in before the mv command in your script and you'll see 

mv ./ABC/abc/ABC ./abc/abc/abc
mv ./ABC/abc ./abc/abc
mv ./ABC ./abc

when what it really needs to do is

mv ./ABC/abc/ABC ./ABC/abc/abc
mv ./ABC ./abc

Not sure why the grep didn't eliminate the middle line but apart from that,
the problem still remains that it's lowercasing all of components of the
filename in one go,

Fergal


On Tue, Apr 10, 2001 at 09:52:58PM +0100, Padraig Brady wrote:
> What's wrong with this?
> 
> find -depth \( -type f -o -type d \) |
> grep -E "/[^/]*[A-Z]+[^/]*$" |
> sed -e '
> {
>     h
>     y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
>     G
>     s/\(.*\)\n\(.*\)/"\2" "\1"/
> }' |
> xargs -r -n2 mv
> 
> -- 
> Irish Linux Users' Group: ilug at linux.ie
> http://www.linux.ie/mailman/listinfo/ilug for (un)subscription information.
> List maintainer: listmaster at linux.ie

-- 




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell