View Single Post
  #1   (View Single Post)  
Old 11th April 2009
bsdnewbie999 bsdnewbie999 is offline
Package Pilot
 
Join Date: May 2008
Posts: 145
Default shell script compare md5 sum

I wrote a script to compare 2 same file but in different dir and filename. The md5 sum of both file is the same but how do i assign the output of md5 sum to a variable like $a and $b? Here's my code
Code:
a=$(md5 /home/abc/sss.sh)
b=$(md5 /home/abc/43/sss.sh)

if [ "$a" = "$b" ]
then 
         echo " match"
else
         echo " no match"
fi
I don't know how to assign the output to a variable.. pls help.
Reply With Quote