I am trying a find a strings of a file matching with another file and collecting them into an array. As a first step, I tried to find a string matching of two files. I used below code, but strangely I am getting this message grep: 3: No such file or directory
,grep: 5: No such file or directory
. I could not figure out the rootcause for this. Can some one help me finding the rootcause? Shell script used:
#!/bin/bash
while
read LINE
do
if grep -q $LINE /tmp/UA_Automation/glhard; then
echo "$LINE"
echo "matched"
else
echo "$LINE"
echo "not_matching"
fi
done < /tmp/UA_Automation/UA_daily_listings_unique_count.csv|awk '{ print $1 }'
glhard & UA_daily_listings_unique_count.csv are name of the file. Contents of these two files respectively are:
glauto
gltyre
gldisc
glclothes
glwheel 2
glgun 3
glauto 4
gldisc 4
glpants 6
Can someone help me figure out this?