why is $0 set to -bash?

Posted by James Shimer on Ask Ubuntu See other posts from Ask Ubuntu or by James Shimer
Published on 2013-10-30T14:06:58Z Indexed on 2013/10/30 16:12 UTC
Read the original article Hit count: 1120

Filed under:
|
|
|

First login process name seems to be set to "-bash", but if I subshell then it becomes "bash". for example:

root@nowere:~# echo $0
-bash
root@nowere:~# bash
root@nowere:~# echo $0
bash

-bash is causing some scripts to fail, such as . /usr/share/debconf/confmodule

exec /usr/share/debconf/frontend -bash
Can't exec "-bash": No such file or directory at /usr/share/perl/5.14/IPC/Open3.pm line 186.
open2: exec of -bash failed at /usr/share/perl5/Debconf/ConfModule.pm line 59

Anyone know the reason $0 is set to -bash?

© Ask Ubuntu or respective owner

Related posts about command-line

Related posts about bash