root won't use bash as login shell
root won't use bash as the login shell. It uses sh. I verify this by two means:
If I start a new root via su from a non-root term, this new root does use bash. How do I force root to use bash? The solution will not involve recompiling the kernel nor changing my distro. |
Quote:
Extract from the bash man page: Quote:
It is fairly common practice to parse .bashrc from .bash_profile so .bashrc thus causing .bashrc to be used for login shells as well as non-login shells. If you want to know what shell you're using you do this: Code:
mike@continuity:~$ echo $0 Code:
mike@continuity:~$ grep ^root /etc/passwd Quote:
|
Quote:
Quote:
If I start a new root via su from a non-root term, this new root does use bash. Quote:
|
Quote:
Quote:
|
thanks for the information, all.
From the information in the helpful replies, it has been determined that there is, in fact, no sh on my system. It's all bash .,.. yet somehow bash acts differently, not reading certain files or reading certain files based on ... still parsing that. Very strange. As the nature of the problem has changed, it will have to go to another thread. |
Quote:
Some things to note are the following:
I hope you can find the problem. |
Sometime /bin/sh is a link to your default shell
booyah ~ $ ls -l /bin/sh lrwxrwxrwx 1 root root 4 Oct 24 00:56 /bin/sh -> bash You can always change that link or user usermod to change the default shell. booyah ~ $ su -c 'usermod -s "/bin/bash" root' Enter your password: Hope this helps. |
Quote:
----------------- Steve Stites |
That we know already :p
By the way, the default shell, if no shebang is included in the script, is the running one, and not the one symlinked to /bin/sh, so that's pointless. And, if your use an #!/bin/sh shebang, then you should stick to the bourne shell syntax, so, the symlinked shell, again, is pointless. |
shebang = #!
# = shh ie shhh im commenting that out ! = BANG! ie my love goes bang bang bang ;-) |
All times are GMT -5. The time now is 07:07 PM. |