All - I am trying to grep for a small string in a much larger string. Both strings are being stored as variables. This code is an example -
#!/bin/bash
long_str=$(man man)
shrt_str="guide"
if grep -q $shrt_str $long_str ; then
echo "Found it!"
fi
I don't think variable expansion is working the way I expect it to. I have tried [] and [[]], also quoting the variables and piping the output to /dev/null. No matter what it won't work.
Ideas?
Thanks, C