I was wondering why this command line does not print pidof sh
$ sh -c "var=`pidof sh` ; echo \$var; ps -H"
This one prints 123 as expected
$ sh -c "var=123 ; echo \$var; ps -H"
I am on ubuntu linux
You miss the quotes. One way to do it:
Notice that they differ in the moment when the
A better way for both would be to use