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
--
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!