hello all,
this is probably very simple for you guys but i am trying to achive something like below...i have 2 files...file 1 has entries like below
DB1:NS
DB2:NS
DB3:NS
DB4
DB5:NS
and file2 as below
DB1
DB2
DB5
i was to write a loop statment were if there is a matching entry from 2 file do nothing else echo things from file2....example is, if(from file1) DB1 = DB1(file 2) then do nothing/exit or else echo file2 info...
i came up with below...but dose not work...
export FILE1=/oracle/tmp/ns
for db in `egrep -i ":NS" $FILE1`
do
echo "processing database: $db"
if [ -f /oracle/tmp/file2 ]; then
cat /oracle/tmp/file | while read LINE; do
if $db = $LINE; then
exit
else
echo "....................NOW PROCESSING INNER DB $LINE"
fi
done
fi
done