LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Root Prompt Changed (https://www.linuxquestions.org/questions/linux-newbie-8/root-prompt-changed-481670/)

baabakb 09-08-2006 03:10 PM

Root Prompt Changed
 
Hi All,

I am not sure exactly what happned but the root prompt in terminal session has been changed from

[root@localhost]#

to

bash-3.1#.

I changed the Shell from bash to sh (I read on the forum that it is not recommended to have the root shell set on bash, not quite sure what it means - very new in linux). Now the prompt of course is saying

sh-3.1#

I would need to ask what could have happened and do I need to change it and how can I change it?

Thanks,

Tinkster 09-08-2006 04:21 PM

Which forum did you read that on?

The only thing you shouldn't be doing is to be logged in and work
as root - which shell you're using won't make much difference in
Linux, since sh is just a symlink to bash on pretty much all distros.


Cheers,
Tink

reddazz 09-08-2006 05:45 PM

The only people that I know who don't recommend bash as roots default shell are the bsd guys. In Linux sh is just a symlink to bash, so explicitly choosing sh does not really achieve much.

AwesomeMachine 09-08-2006 05:48 PM

I just wanted to repeat what the TWO moderators said: "sh is a symlink to bash". I think you can get your original prompt back by typing:

bash

Tinkster 09-08-2006 09:03 PM

Quote:

Originally Posted by reddazz
The only people that I know who don't recommend bash as roots default shell are the bsd guys. In Linux sh is just a symlink to bash, so explicitly choosing sh does not really achieve much.

It does make a difference in Solaris, the sh root uses there
is a statically linked executable, and not just a symlink to a
different shell. The advantage is that even if /lib or /usr/lib
were on separate file-systems and their mounting failed for
some reason you'd still have a shell :} (or something like that -
it's been a while that I was on my course, and never had any
issues that would warrant a closer examination since).


Cheers,
Tink

gilead 09-08-2006 09:31 PM

It makes a difference in Linux as well. From O'Reilly's Learning the bash shell:
Quote:

If bash is started as sh its startup behaviour will change slightly to mimic the Bourne shell as closely as possible. For login shells it only attempts to read /etc/profile and ~/.profile, ignoring any other startup files like ~/.bash_profile. For interactive shells it won't read the initialisation file ~/.bashrc. bash also enters POSIX mode when started as sh. Versions of bash prior to 2.0 don't...
I'm only nit-picking because I don't have anything to add... ;)

reddazz 09-09-2006 03:55 AM

Quote:

It makes a difference in Linux as well. From O'Reilly's Learning the bash shell:
Quote:

Quote:
If bash is started as sh its startup behaviour will change slightly to mimic the Bourne shell as closely as possible. For login shells it only attempts to read /etc/profile and ~/.profile, ignoring any other startup files like ~/.bash_profile. For interactive shells it won't read the initialisation file ~/.bashrc. bash also enters POSIX mode when started as sh. Versions of bash prior to 2.0 don't...
I'm only nit-picking because I don't have anything to add...
Yeah, but you will still be using bash even though its mimicking sh behaviour. On FreeBSD and Solaris, sh is a totally different shell to bash.


All times are GMT -5. The time now is 07:23 PM.