0

I have recently started learning UNIX for a week or so and I've played around with the bash_profile and bashrc files to add in some basic preferences. But today, I couldn't execute several terminal commands and after investigating, I found that the default shell I was in was called "-bash" (not "bash").

Terminal shell reads "-bash" instead of "bash"

enter image description here

I am relatively new to UNIX and it's possible that I unintentionally deleted / modified a file that I shouldn't have and now when I launch a Terminal, I'm in this "-bash" shell. I have since deleted my bash_profile and bashrc files assuming that these were the cause but I still open in this shell that looks like a typo and I'm not sure how to fix it.

I also tried setting my default shell in the Terminal to Bash will no luck.

I know I could just configure my bash_profile / bashrc to enter a bash shell automatically at login but I think that would be a pushing this issue under the rug until I realize that there is something else wrong with my terminal configuration.

  • 3
    That looks like OSX, is it? Please edit your question and tell us what operating system you're using. Also tell us what terminal commands failed and with what error messages. Finally, please don't post screenshots of text. It's not a big deal in this case but it's better to just paste it in directly and use the formatting tools. – terdon Jul 10 '16 at 17:06
5

The - in front of the shell name is actually normal. It's how the system tells the shell that this is a "login shell" and so to run additional startup scripts such as .bash_profile.

In my case, for example, I have:

% echo $0
-ksh

This is pretty standard across all Unix platforms and not something to be concerned about.

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.