vim can not execute unix command with :! due to shell changing
Solution 1:
Put this in your .login script:
setenv SHELL /bin/bash
exec bash -l
The first line sets the SHELL environment variable. The second line replaces the tcsh
with bash
, but tells it to run as a login shell (so bash
will process your .profile
etc). You could add a -i
option to make it interactive; it should not be necessary.
Solution 2:
The default shell for any user is stored in the /etc/passwd file. The user can change their default shell to any of the shells listed in /etc/shells by issuing the chsh
command. Consult the manual pages of chsh(1) and shells(5) for more information.
This answer is "more correct" than the approach of replacing the current shell after logging in because it is unnecessary to start the undesired shell in the first place. That approach is useful only when the administrator has neglected the /etc/shells file and forgotten to add bash to it (never).