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 is the operator =~ called? I'm not sure it has a name. The bash documentation just calls it the =~ operator. Is it only used to compare the right side against the left side? The right side is considered an extended regular expression. If the left side matches, the operator returns 0, and 1 otherwise. Why are double square brackets required when running a test? Because =~ is an operator of ...
For understanding bash code it is usually very helpful to set the -x option: set -x # within a script / function or when calling a script: bash -vx ./script.sh With loops this is a little less helpful. But you can always take the first part of the command and do this: echo for url in $(cat example.txt) That shows you what happens there (at least the result). This feature is called "command ...
bash - What does $ ( ... ) mean in the shell? - Unix & Linux Stack Exchange
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.