Friends,
I am rather new to sed and awk and could use a bit of help
I am loopng through a dir of jpegs and printing the MD5 hash values into a text file
here is what I have
#!/bin/bash
# ~~~~~~~~~~batch kri-mov [dv25] to mp4
# ~~~~~~~~-make 1 mp4 ** Hints the mp4 ***
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~V 1 ; 7.11.2012
#-----------------------------------alias on ssx2
#
#################################################################################
movDir=~/Pictures/0
echo $(date) >> $movDir/aaa_md5.txt
echo "STARTING "
####################------------------ the meat
cd $movDir
for f in *.jpg ; do
#for f in *.mp4 ; do
## sed 1 ---- sed 's/MD5//g' removed MD5
## sed 2 ---- sed 's/[)(]//g' removes the ( & )
##
md5 ${f%.*}.jpg | sed 's/MD5//g' | sed 's/[)(]//g' >> $movDir/aaa_md5.txt
done
this makes a line ( 1 for each jpg ) in the txt file: aaa_md5.txt
that looks like
Abstract-Art-Backgrounds.jpg = cbd84a06af6a021033039802f69d548d
before i did ANY sed it looked like
MD5 (Abstract-Art-Backgrounds.jpg) = cbd84a06af6a021033039802f69d548d
so this is better but Also have wish to print into a second txt file the following , just the hash value , like this for every line.
cbd84a06af6a021033039802f69d548d
so I was trying to do something like
** a sed that grabs only that which is to the right of "=" and that becomes $hash , basically the hash val only in a var called $hash
I tried expr ... but failed.
I am also thinking about entering the hash value into a database with a get
so -- since as i loop
I know what the file is - $f
if i also had the hash value - $hash
I am hoping I can do the sql call to shove that value into the db.
as i loop
thanks much!
also - aplolgies for calling sed twice ...i am sure there is a better way.