I recently stumbled upon a problem in a bash script. I was doing something like this:
Basically, when I was echoing, after the while, I was expecting the modified value to be shown.
However, piping into something will create a new subshell, and thus the modification is only
visible inside that shell. This link gives some useful examples
on process substitution. The fix was to rewrite that loop like this: