To find String mismatch

Hi,

I have a doubt when searching files for the existence of a particular key.

I have a property file has data with key and value pair like below and i call it as property file.ini

here are the contents in File: popertyfile.ini

location.property=2
agent.method=begin
newkey=23

I some place in my disk i will have files in different locations.

ex: /opt/Agent/abc.properties
/opt/Agent/xyz.properties

contents of abc.properties are

location.property=2
.....

contents of xyz.properties are

agent.method=begin
....

Now my program should read the keys in the propertyfile.ini

and comapre each key with the files abc.properties and xyz.properties

if a key is not maching with any of the keys in the both files it should display error.

ex:
in the above propertyfile.ini
newkey is a key which is not present in both the files abc.properties and xyz.properties.

in such case it should throw error only once saying that it is invalid key.

please help me on solving this issue.

Thanks in advance,
RaghuDeep Amilineni

What have you tried so far to solve the issue?

i just checked the values

if [ $KEY != location.property -a /
$KEY != agent.method ]; then
echo "invalid key"
fi

but i should not hard code the keys to compare..