In Bash, there appear to be several variables which hold special, consistently-meaning values. For instance, ./myprogram &; echo $! will return the PID of the process which backgrounded myprog...
bash - What are the special dollar sign shell variables ... - Stack ...
bash - What is the purpose of "&&" in a shell command? - Stack Overflow
What's the difference between <<, <<< and < < in bash? Here document << is known as here-document structure. You let the program know what will be the ending text, and whenever that delimiter is seen, the program will read all the stuff you've given to the program as input and perform a task upon it. Here's what I mean: $ wc << EOF > one two three > four five > EOF 2 5 24 In this example we ...The =~ operator is a regular expression match operator. This operator is inspired by Perl's use of the same operator for regular expression matching. The [[ ]] is treated specially by bash; consider that an augmented version of [ ] construct: [ ] is actually a shell built-in command, which, can actually be implemented as an external command. Look at your /usr/bin, there is most likely a ...
If not quoted, it is a pattern match! (From the Bash man page: "Any part of the pattern may be quoted to force it to be matched as a string."). Here in Bash, the two statements yielding "yes" are pattern matching, other three are string equality:
Furthermore, when you use bash -c, behavior is different than if you run an executable shell script, because in the latter case the argument with index 0 is the shell command used to invoke it. As such, I think the way to fix this answer is to change it to execute scripts as files instead of using bash -c, since that's how the asker was doing it.