I am trying to grep for a small string in a much larger string. Both strings are being stored as variables and here is a code example:
#!/bin/bash
long_str=$(m
if echo "$long_str" | grep -q "$shrt_str";then
echo "found"
fi
or
echo "$long_str" | grep -q "$shrt_str" && echo "found" || echo "not found"
But since you are using bash shell, then use shell internals. No need to call external commands
shrt_str="guide"
case "$long_str" in
*"$shrt_str"* ) echo "Found";;
* ) echo "Not found";;
esac