Hi Guys, Thanks for the reply,
rakeshawasthi: == is correct I think, for testing the values.
danmero: The second "read" should be a single line value return, so no while needed (I'll add a head -1 to it at a later point)
The two input files are:
$DATAFILE:
20090615,179426984 454 test/UBUSB.exe.lnk
$OLDDATAFILE:
20090615,179426984 454 test/UBUSB.exe.lnk
So in this case, oldcksum should return the same 179426984, and then the STATE would be set to SAME.
The whole script, is comparing all of the files in the folder and sub-folder to a list generated x days ago. I need to see which cksums have changed.
-----Post Update-----
So I know the first while loop is reading STDIN. What I cant see is how to get a second read-from-file statement to work.
-----Post Update-----
ok - managed to get it working like this:
cat $DATAFILE | while IFS=", " read curdate currentcksum other filename
do
oldcksum=`grep "$filename" $OLDDATAFILE | cut -f1 -d" " | cut -f2 -d","`
STATE=DIFFERENT
Dont know why that convoluted way works..
-----Post Update-----
ok - managed to get it working like this:
cat $DATAFILE | while IFS=", " read curdate currentcksum other filename
do
oldcksum=`grep "$filename" $OLDDATAFILE | cut -f1 -d" " | cut -f2 -d","`
STATE=DIFFERENT
Dont know why that convoluted way works..