Hello,
When I run this script, here's what I get:
Searching ...
found 1111
2222
3333
.....
7777
.....
8888
9999 in 95_test
Search completed.
I expected only to see what number was found in the file, not including the ones not found.
Thanks for your help!
#!/bin/sh
dataFolder=$1
echo "Searching ..."
for number in "`awk -F"|" '{print $3}' ../$dataFolder/45_test.txt`" ; do
#echo "$number"
for filename in `grep -il "$number" ../$dataFolder/95_test.txt` ; do
if [ -n "$filename" ] ; then
echo "found $number in 95"
fi
done
done
echo "Search completed."
exit 0