Attempting to create a script that reads from to separate files, one file has list of IP address and host types, second file has list of host types also. The goal of the script is to return result of the pings and insure the host type listed in the first file matches the list of host types in the second file.
Below is my script, I'm getting unary operator expected error message on line 15, below is my script, any suggestions on how to get this to work?
#! /bin/bash DIR=/etc/pinger #bTYPE=Router exec 3< $DIR/pinger.conf while read bIP bTYPE <&3 do #echo "$bIP $bTYPE" exec 4< $DIR/host_type.conf while read bHOST <&4 do if [ $bHOST == $bTYPE ] then echo "$bHOST - $bTYPE" exit 1 fi done done