I haven't read very deep into what you've said, but I'm going to take
a leap of faith, and pretty much fundamentally disagree with everyone
here ( except perhaps Paul Murray ).
I don't think you should bring this to a bash-specific group, unless
you're already involved with such a group. I don't think you should
write it in anything else ( except perhaps ksh, or perhaps tcl, but
that would be only if you know them better than bash ).
I would need to examine your problem a bit closer, but I think if you
have a good look through the manuals for find and cpio, you will get
yourself 90% of the way there.
I think you're loking for something along the lines of
[oldserver]$ find /location/of/old/maildirs/*/.maildir/{cur,.*}
-exclude .Trash | cpio -o | ssh newserver 'cpio -i '
I believe cpio has an option for string substitution that you could
use to change /old/maildirs to /new/maildirs ( or you could just
create a temporary symlink structure to simulate the old environment
). I'd need to check the man page for find - I don't think the exclude
option is just -exclude ( if you can't find it, just use grep ) as in
( find ... | grep -vf .Trash | cpio )
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!