Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

-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/ line 186.
open2: exec of -bash failed at /usr/share/perl5/Debconf/ line 59

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

share|improve this question
@RaduRădeanu Useless Use of Cat spotted! – gniourf_gniourf Oct 30 '13 at 14:52
up vote 3 down vote accepted

If the output of echo $0 command is -bash it means that bash was invoked as a login shell. man bash says somewhere at line 126:

A  login shell is one whose first character of argument zero is a -, or 
one started with the --login option.

See more about here: Difference between Login Shell and Non-Login Shell.

So your shell is still /bin/bash (this can be checked with echo $SHELL command) and I suggest you to use that command which give you error as normally:

exec /usr/share/debconf/frontend bash
share|improve this answer
Thanks, it does appears that login is correctly adding the "-" to the login shell process name. That answers my question. – James Shimer Oct 30 '13 at 17:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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