Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: ali on September 01, 2011, 11:19:28 PM
-
i'm interested in changing my shell from sh to bash, i notice the chsh command is not available here so what can i do to change it?
-
Hi ali
Have you tried installing bash.tcz ?
-
Apart from the obvious requirement to have the alternative shell installed I believe you will need to ensure that 'bash' is an "acceptable" login shell, e.g. via:
which bash | sudo tee -a /etc/shells > /dev/null
and that the respective field has been update in the user accounts, e.g. via
sudo sed -i '/^ali:/s#:[^:]\+$#:/usr/local/bin/bash#' /etc/passwd
(which assumes that the change should be applied only for user 'ali').
EDIT: Corrections to the second command (it needed '-i' and also has to be run by a super-user).
-
ali@mini:~$ cat /etc/passwd | grep ali
ali:x:1000:50:Linux User,,,:/home/ali:/bin/sh
ali@mini:~$ which bash | sudo tee -a /etc/shells > /dev/null
ali@mini:~$ cat /etc/passwd | grep ali
ali:x:1000:50:Linux User,,,:/home/ali:/bin/sh
ali@mini:~$ sed '/^ali:/s#:[^:]\+$#:/usr/local/bin/bash#' /etc/passwd
root:x:0:0:root:/root:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/false
tc:x:1001:50:Linux User,,,:/home/tc:/bin/sh
ali:x:1000:50:Linux User,,,:/home/ali:/usr/local/bin/bash
ali@mini:~$ cat /etc/passwd | grep ali
ali:x:1000:50:Linux User,,,:/home/ali:/bin/sh
ali@mini:~$ cat /etc/shells
# /etc/shells: valid login shells.
/bin/sh
/bin/ash
/usr/local/bin/bash
-
There were two minor mistakes in the 'sed' command: It needed the '-i' option to work in-place , and it needs to be run by 'root'. I've therefore updated reply #2.