>> Feel free to ignore me here, but if anyone could whip out a quick
>> script for this I would really appreciate it.
>>
>> I need to move any files from dir1 to dir2 if they don't already
>> exist in dir2 with a slightly different filename.  The dir1 files are
>> named like a-1.jpg and the dir2 files are named like
>> a-1_original.jpg.
>>
>> - Grant
>
> rough and ready, off the top of my head:
>
> cd dir1
> for i in *jpg
> do
>  j = basename $i .jpg
>  cp -u ${j}.jpg dir2/${j}_original.jpg
> done
>
> 'cp -u' works around the messy problem of checking if the destination
> file exists

Thanks guys, can you tell me how to execute this?  Put it in a file
and './file' I think?  Should I have special stuff at the top of the
file?

- Grant
-- 
gentoo-user@lists.gentoo.org mailing list

Reply via email to