An easy way to change your shell
An easy and correct way for a user to change his/here shell is by using the “chsh” command.
chsh stands for change shell, and does exactly what the name suggests.
Invoke it with no arguments and you will be prompted for your password, then you will be prompted for your shell.
The file /etc/shells is consulted, and your chosen shell must be included in there for your change to be accepted. If you enter the name of a binary which is not contained in /etc/shells you’ll receive an error: ” ‘Entered line’ is an invalid shell”.
user@linux~$ chsh
Password:
Changing the login shell for user
Enter the new value, or press return for the default
Login Shell [/bin/sh]: /usr/bin/fish
Here we change the shell to the fish shell or you can change it to zsh with /usr/bin/zsh
More information about the fish shell can be found here.
More information about the zsh shell can be foudn here.
[Of course, you mean "zsh" where you wrote "fish"]
If you’re on a NIS/YP (or other centrally managed) system where chsh doesn’t work for whatever reason (no access to the NIS master, necessary RPC services not running), you can also exec a shell from the shell init files of whatever inferior shell happens to be installed on the system by default (on Linux systems, it’s often the hopeless bash — bloody awful shell).
It pays to be a bit careful with the execing in case the local BOFH destroys your shell because he doesn’t know what it is (test -x is your friend) or in case some library your shell depends on is incompatibly changed (rc=$shell -e …).
Sensible shells like zsh set $SHLVL in the environment so you can prevent recursive execing easily.
Often things are not as easy as you think they may be…
Aside: your comment gadget closes my Mozilla window when I press ctrl-W. Why?
Well have left the fish shell for what it is and tried the zsh. After some reading and configuration I got well adjusted to it. But when I found this thread: http://nocturn.vsbnet.be/node/108
I read through your dotfile of zsh and i must say I’m going to study it well
I have some more “advanced” dotfiles which I don’t publish for various reasons (note the conditional sourcing of .local files at the end of every “standard” dotfile) which you may be interested in. These have voodoo for things like ClearCase and Perforce and for making life with ddd more tolerable. Reason I don’t publish them is because they contain references to customers I prefer not to broadcast. Send me email if you’re interested though and I can possibly suitably anonymize them for your enjoyment. The Philip* conspiracy should help each other out eh.