Hello Guys
I need to read and compare two file, one file contains hostname, and others contain hostname and IP@,
and the objective is to read each file and compare if line in file1 equal to first word in the second file2
file1
file2
this is my first code
fqdn_hosts=list.txt
named_hosts=infra.hosts
for line in `cat $fqdn_hosts`
do
for line2 in `cat $named_hosts`
do
if $line -eq $line2 | awk -F: '{print $1}'
then
echo $line '$line2 | awk -F: '{print $4}''
fi
done
done
can you help me, please