data1.txt file contains one line of string text; "Hello".
data2.txt file contains multiple lines of string text, including "Hi, Hello, Greetings," and "Salutations".
I want to compare the single line from the first file to the multiple lines of the second file and return a true false value for a matching string.
but I seem to be missing something...
Code: Select all
set -eu
matched=$false
string=./Data1/data1.txt
if grep -n "$string" ./Data1/data2.txt;
then $matched=$true
./messagebox;;
else
echo "failure"
fi