I have a string in Bash:
string=\"My string\"
How can I test if it contains another string?
if [ $string ?? \'foo\' ]; then
This Stack Overflow answer was the only one to trap space and dash characters:
# For null cmd arguments checking to_check=' -t' space_n_dash_chars=' -' [[ $to_check == *"$space_n_dash_chars"* ]] && echo found