Hi there,

first of all, I would recommend that you take a bash scripting tutorial
such as the one at the URL below:

http://linuxconfig.org/Bash_scripting_Tutorial

Now, to solve your particular problem please note that I'm not at all
familiar with Claws-Mail. However, based on the hints you provided, you
could follow these 3 steps to solve your problem:

1) go to computerA on ./Mail/inbox/Angebote and find out the highest number
of the message in there - let's suppose it's 12345

2) go to computerB/Mail/inbox/Angebote and (providing your shell is
/bin/bash) run the following oneliner (please note that in the line of code
below 12345 is the number of the message you found in the previous step).
This will rename all your files on computerB so as not to have overlapping
numbers for the messages on the two computers.

--- cut here ---
ls -1 | while read old_fn; do new_fn=$(($old_fn+12345)); mv $old_fn
$new_fn; done
--- and here ---

3) move all the messages from computerB/Mail/inbox/Angebote to
computerA/Mail/inbox/Angebote (or the other way around)

That should be it. You can see below how I've renamed files 1, 2, 3 and 4
to 12346, 12347, 12348 and 12349. Hope that helps.

--- cut here ---
nwo:Angebote grn$ ls -1
1
2
3
4
nwo:Angebote grn$ ls -1 | while read old_fn; do new_fn=$(($old_fn+12345));
mv $old_fn $new_fn; done
nwo:Angebote grn$ ls -1
12346
12347
12348
12349
--- and here ---

-- 
GRN
Eagles never flock together, you discover them one at a time.
http://twitter.com/georgenica

On Mon, Jun 4, 2012 at 11:42 AM, Reginaldo Stückner <
[email protected]> wrote:

> Hi,
>
> i am working with " Claws-Mail " on two different computers. Now i have
> to merge the emails ( hundrets in different directories ) - because i
> want to have the same state on both computers.
>
> Every email is stored i a seperate, single file and named very simple
> with a number, see the example :
>
> internet@netbook:~$ ls -l ./Mail/inbox/Angebote/
> insgesamt 3008
> -rw------- 1 internet internet   7442  8. Mär 2011  1
> -rw------- 1 internet internet  52824 26. Apr 2011  10
> -rw-r--r-- 1 internet internet  52824 23. Jul 2011  100
> -rw-r--r-- 1 internet internet   4170 23. Jul 2011  101
> -rw-r--r-- 1 internet internet  29068 23. Jul 2011  102
>
>
> But i can NOT move one directory directly to the other place because if
> the file named as 10 exists on the other side, i have to rename it to
> the next free ununsed number, maybe 103.
>
> And in this way i have to take the next file form one computer, take
> next a look if the same number exists on the other side, and if not, i
> can move it directly, otherwiese i have to test if the next "
> number / file " exists, next rename the original file and move it
> renamed with a new higher number to the new place.
>
> So i think this is a good job for a script, but my knwoledge is not
> good enough to write such a script.
>
> But maybe some one of you has more time spend with scripting and can
> offer me such a simple (?) script that is doing this job better than
> if i do it manually ?
>
_______________________________________________
RLUG mailing list
[email protected]
http://lists.lug.ro/mailman/listinfo/rlug

Raspunde prin e-mail lui