On Wednesday 27 March 2002 04:32 am, Adam Murdoch wrote:
> > -----Original Message-----
> Unfortunately, to solve your particular problem, I think you will have to
> write your own mapper implementation.  It's not particularaly hard -
> implement FileNameMapper to do the appropriate conversion, compile it up,
> and use <mapper classname=".." /> to use it.

Not to discount that approach, but if you just need this as a one-time fix, 
you could use something like this from the shell:


for d in $(find test -type d | sort -r); do   
        newname=$(echo $d | perl -pe 's/_(\w+)$/$1/;')
        test "$d" = "$newname" && continue
        mv $d $newname
done

Here's what it looks like on my machine:

stephan@cheyenne:~/tmp> rm -fr test; mkdir -p test/_foo/_bar; mkdir -p 
test/_one/_two
stephan@cheyenne:~/tmp> find test
test
test/_foo
test/_foo/_bar
test/_one
test/_one/_two
stephan@cheyenne:~/tmp> for d in $(find test -type d | sort -r); do   
newname=$(echo $d | perl -pe 's/_(\w+)$/$1/;');   test "$d" = "$newname"
&& continue;   mv $d $newname; done
stephan@cheyenne:~/tmp> find test
test
test/foo
test/foo/bar
test/one
test/one/two


-- 
----- stephan
Generic Unix Computer Guy
[EMAIL PROTECTED] - http://www.einsurance.de
Office: +49 (89) �552 92 862 Handy: �+49 (179) 211 97 67
"...control is a degree of inhibition, and a system which is perfectly
inhibited is completely frozen." -- Alan W. Watts

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to