Using If_ELSE, how do check a particular piece of data in a file. My data file has three columns and say I want to check the data in the 2nd column. I want to do a comparsion against a another piece of data using IF_ELSE. How do I get that data in file to check?
while read A B C
do
if [ "$B" = "slartibartfast' ]
then
echo "do something"
else
echo "don't do something"
fi
done <input