i=$(cat /etc/icinga/devices.d/xlcdw/full)if IP in grep -q $i /etc/icinga/devices.d/xlcdw/xlcdw-endpoints.cfg;    echo Already configured  else    echo $IPfiI'm trying to see whether the hosts I have already configured in the .cfg file are present in the file named 'full.' Of course the above code doesn't even run. I'm grepping for their IP addresses. 
compare two files using loop to see what strings are not in both files
text processing;files;grep
I take your pieces of information out of the comments:the file full is one IP address per line. The .cfg file contains all kinds of alphabetic text in addition to IP addresses.andI need to iterate over the 'full' file to see if the IPs inside it (one per line) are also in the .cfg fileSo you want to iterate, which your script does not.Try with a for loop:for IP in $(cat /etc/icinga/devices.d/xlcdw/full); do  if [[`grep -c $IP /etc/icinga/devices.d/xlcdw/xlcdw-endpoints.cfg` > 0 ]]; then    echo $IP already configured  else    echo $IP missing  fidoneAdapt that to your needs (which I don't fully understand)