I just encountered that the output of wc -l differs when called directly or enclosed in backticks. For example:
pgrep bash | wc -l
would output 1, as there is one bash process running. But enclosing this command in backticks
echo `pgrep bash | wc -l`
would output 2. I first thought, the backticks would open a new bash process, but
echo `pgrep bash`
does only find the same one process as above. The same is when enclosing the command in $():
echo $(pgrep bash | wc -l)
This will also output 2. Does somebody know why that is so?