11-07-2006
4,
0
Join Date: Nov 2006
Last Activity: 7 November 2006, 4:49 PM EST
Posts: 4
Thanks Given: 0
Thanked 0 Times in 0 Posts
Need help in genrating the logic
Hi,
I am little new to unix programming. I need some help in the program I am working on. I am looking for some effective way to do this. I have few file process something like below:
FLAG=0
$Process_Date="20060631"
. $COM/cat.ksh inquire file1 dat
if (( $? == 0 ))
then
export Emm1=$Hfile1
export Emm1_DATE=$HDate1
else
exit 1
fi
. $COM/cat.ksh inquire file2 txt
if (( $? == 0 ))
then
export Emm2=$Hfile2
export Emm2_DATE=$HDate2
else
exit 1
fi
. $COM/cat.ksh inquire file3 doc
if (( $? == 0 ))
then
export Emm3=$Hfile3
export Emm3_DATE=$HDate3
else
exit 1
fi
. $COM/cat.ksh inquire file4 doc
if (( $? == 0 ))
then
export Emm4=$Hfile4
export Emm4_DATE=$HDate4
else
exit 1
fi
and so on.....there are few more process like this....
Once the filename is passed in the cat.sh it generates a date for that particular file($HDate) as show above in bold. All I am trying to do is, if the $HDate for a file is not equal to the $Process_Date put a FLAG=1 for that file and in the end of the script I need to print all the files whose $HDate did not match with the $Process_Date and abort the script.
For example in above script let say for file1 and file2 the $HDate did not match with the $Process_Date, I still want the script to run till the end and compare the HDates for other files like file3 and file 4 and in the end once all the files are checked for the dates, I want to print the files whose dates did not match and abort.
I will really appreciate your help and advice in this regards.
Thanks
Amit