There are at least 3 possible ways of calling a bash script:
:~$./myscript :~$bash ./myscript :~$bash -c "./myscript"
One said that in the case #3 invocation (
-c option) there is one more bash process in the hierarchy. I've prepared a simple test script:
echo "SHLVL: $SHLVL" ps aux | grep bash
SHLVL is indeed greater by one in the #3 case, but the
ps doesn't output any extra bash process in the #3 case. The only bash process connected to the script is
So where is this extra bash process?