You are not logged in.
All my pictures are named, and I want to copy the name to the jpeg comment. Looks like jhead would work with jhead -cl string file, and I'm trying to figure out that magic command that will take all my files in a directory and copy the filename to the comment field.
Best I can come up with so far is
jhead -cl $F *.JPG
but that needs a lot of work. Can anyone help me out?
Last edited by sinister99 (2008-07-22 12:17:47)
Offline
Heres a bash script to do it:
#!/usr/bin/bash
for x in $(ls *.jpg)
do
jhead -cl $x $x
done
Offline
That almost works, the only problem is some pictures have spaces in their names, and it doesn't work for those.
Offline
Okay, heres a modified version:
ls|while read i; do jhead -cl $i $i; done
Offline
you could do ls -1
I need real, proper pen and paper for this.
Offline
no no! for i in *.jpg
and surround $i in quotes.
Offline
I got it, thanks to all for the help
ls -1|for i in *.JPG; do jhead -cl "$i" "$i"; done
Offline
for i in *.JPG is enough actually It's expanded.
I need real, proper pen and paper for this.
Offline