I have a file out.csv I have to check if the name inputed by user exists in the file(comma separated) or not. I am taking name using read but while checking for equality I am getting error
IFS=","
while read tname tnum
do
if [ $tname -eq $name ]; then
flag=1
break
fi
done < out.csv
echo "$ch"
[ "$tname" = "$name" ]
. Leave off the quotes only if you've read When is double-quoting necessary? and remember all the rules and hate the next person who will maintain that script. – Gilles 'SO- stop being evil' Sep 08 '13 at 23:00