My system is Debian 9.4 which uses linux kernel 4.9.0-8-amd64 and echo $SHELL on my system gives /bin/bash and /bin/sh is a link to /bin/dash.

I was curious of why every time I run an application with dmenu_run from dwm ththere is an additional /bin/bash process being ran as the parent, so I digged into the script of dmenu_run a bit:

dmenu_path | dmenu "$@" | ${SHELL:-"/bin/sh"} &

I can't understand why my computer have /bin/bash instead of /bin/sh. I also read the correspond source code in dwm. It shows that it just simply fork and execvp dmenu_run. There is no reason for /bin/bash to be ran instead of /bin/sh.

  • What is the output of ls -l /bin/sh. Maybe this is a soft link.
    – Prvt_Yadav
    Nov 10 '18 at 8:26
  • #Debbian_yadav Sorry, I forgot to post that.
    – JiaHao Xu
    Nov 10 '18 at 8:39

Typically, /bin/sh is a symbolic link to /bin/bash in systems that use bash as the default shell.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.