I'm trying to use a shell script to get the string from one file, then use it to get the matched sentence.
The script looks like this:
function find_str (){
echo $1
grep -e "\/$1" info.txt
}
for word in $(<./name.TXT); do
#egrep -w "$word" info.txt #this can't work either
find_str $word
done
It turns out that find_str $word
cannot match some string like "/WORD1 balabala"
Any suggestion about this short piece of script?