Rename pictures in the command-line interface
Polytropon
freebsd at edvax.de
Mon Jan 4 19:59:18 UTC 2010
On Mon, 04 Jan 2010 20:13:57 +0100, Dário "P." <fbsd.questions.list at gmail.com> wrote:
> The sorting order is not a big problem for me, at least for now. I'm
> doing the renaming in one machine with GUI then I upload the pictures to
> another machine. The only reason that I need this, is because sometimes
> I delete one picture on the other machine and then I have to rename
> everything again.
In this case, pay attention that the renumber script does
not pay attention to not overwrite files. This can lead to
problems when adding files. Let's say you have
pic_01.jpg
pic_02.jpg
pic_03.jpg
and add a file new.jpg, so you have
new.jpg
pic_01.jpg
pic_02.jpg
pic_03.jpg
If you now run
renumber pic jpg
you'll have
pic_01.jpg = new.jpg
pic_02.jpg = pic_01.jpg
pic_03.jpg = pic_02.jpg
pic_04.jpg = pic_03.jpg
and the "source pics" will be "removed", so you end up with
pic_04.jpg = neu.jpg
A workaround is to use the MC to prefix all files with an
arbitrary letter, and THEN run renumber, e. g. select all
(grey *), PF6, to "X*" (where "X" is the arbitrary letter)
and have
Xnew.jpg
Xpic_01.jpg
Xpic_02.jpg
Xpic_03.jpg
which can be processed with "renumber pic jpg" now without
any problems because the existing prefix isn't the same as
the renumbering prefix.
As you see: I have a reason to believe that I should better
write a new script that takes such things into mind and maybe
offer reverse renumbering, overwrite protection and a better
selection which files (instead of hardcoded *) to process.
> > So if you wish to do some file preparation, know that the
> > powerful Midnight Commander can do this for you (select and
> > PF6).
>
> Anyway, I gonna look at it.
It's worth it. The MC is a powerful and still easy to use
tool for file administration.
--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions
mailing list