Sat, 16 Aug 2008, by drankinatty@suddenlinkmail.com:
David C. Rankin wrote:
Listmates, What I want to do is something like: for i in $(ls); do ORIG_FNAME=$i NEW_FNAME=$(echo $i | sed -e 's/^100/`date +%Y%m%d`/') This is where the trouble comes in. I can't see a way to accomplish this. Anybody have any ideas? I guess I could turn the problem around and grab the numerical part on the right side of the _ with sed and then concatenate the date to that. However, if this is a way to work a variable into sed, that would be great. Any ideas?
I took the easy way out...
for i in $(ls); do
ORIG_FNAME=$i PICNUM=$(echo $i | sed -e 's/^100//')
NEW_FNAME="$TODAY$PICNUM" mv $ORIG_FNAME $NEW_FNAME
There is a tool for this you know (not surprisingly, this is
Linux..), look at exiftool(1)
I think you could use one of these examples from the manpage.
exiftool '-FileName