![]() |
Make BASH the default shell
Hi all ; Sorry if this info exists elsewhere, I searched for it but the search engine is weird...
I installed BASH4 but I can't seem to use it, no matter what I do, echo $SHELL returns /bin/sh How can I make BASH the default shell for both user and root ? |
Re: Make BASH the default shell
I once replaced the default shell by the z-shell (zsh). However, I wasn't able to reboot then (Maemo didn't come up --> reflash).
So if there is a possibility to change the default shell, it's not replacing the entry in /etc/passwd... |
Re: Make BASH the default shell
Replacing the entry in /etc/passwd works if the shell is compatible with the Maemo scripts which are run at boot. Bash 3.2 is compatible, I run it for a long time as the default shell with no problems. Bash 4 SHOULD be compatible but I haven't tested it (no need for it), you can try replacing the entries in /etc/passwd (ONLY for user, root and eventually others users that you created) but make a backup first.
|
Re: Make BASH the default shell
I've been using bash4 as the default shell for a few weeks now, and I've had no issues.
As Megaltariak said, you need to edit your /etc/passwd, and replace /bin/sh with /bin/bash, for root and user; be careful as a typo, or replacing the wrong entry will lead to problems. e.g. change user:XXXX.XXXX:XXX:XXX::/home/user:/bin/sh to user:XXXX.XXXX:XXX:XXX::/home/user:/bin/bash the XXX's in your case will be a bunch of digits. |
Re: Make BASH the default shell
So I'm not sure if there is something I've done wrong here, but following jd4200's advice above, I am now not able to boot the N900. Here is what I did exactly:
1. I previously had Bash 3.2 installed and working on the N900 X Terminal, but was hoping to update to Bash 4. 2. I installed Bash 4 from Extras-Dev 3. I uninstalled Bash 3.2 using App Manager (HAM). 4. In the X Terminal (now running Busybox), I used 'sudo vi /etc/passwd' to update the passwd file, replacing '/bin/sh' with '/bin/bash' for user and root and saved. 5. When restarting X Terminal, it errored out and quit (I'm not sure where the log files are for X Terminal, so if there is more I can provide let me know where to pull it). 6. When restarting the device, the N900 hangs indefinitely. 7. I restarted using the rescue initrd and changed the /etc/passwd file back to using '/bin/sh' for user and root. 8. N900 still does not boot up. Since I am able to get to the device, I have no issue rescuing my data and flashing the device (I've done this plenty of times), but I am not sure if I did something wrong or if the instructions above are incorrect. Let me know if you have any comments on what I could have done wrong - otherwise, I'll let this stand as a warning for anyone looking to the directions above. |
Re: Make BASH the default shell
Quote:
|
Re: Make BASH the default shell
Quote:
Code:
ln -s /bin/bash4 /bin/bash |
Re: Make BASH the default shell
Out of paranoia, I use a .profile entry that checks whether 'sh' is being run in interactive mode AND whether bash is available, and if so execs it:
Code:
if [ $SHELL = "/bin/sh" ]; then |
Re: Make BASH the default shell
The simple way to do this is to run:
chsh Then give it the path to the shell you want to run. I think chsh is installed by default. |
All times are GMT. The time now is 05:02. |
vBulletin® Version 3.8.8