• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1764
  • Last Modified:

change default shell

hi all,
       I am just a unix(solaris) shell user(not root) and i login via telnet and everytime i login i get ksh as my default shell.I was wondering if i could change it to bash instead.I cannot change /etc/passwd file line for changing it as i am not a super user.Is there any other way to do it?

Thank you.
0
dex11
Asked:
dex11
  • 2
1 Solution
 
Hanno P.S.IT Consultant and Infrastructure ArchitectCommented:
a) Manually:
    exec bash
b) Automatically:
    As you are running ksh as default shell, just create/edit your local
   login script .profile adding the line
       exec bash
   at the end.
   If you are using CDE for graphical login, add it like below.

To tailor your shell's behavior you can also add stuff into ~/.bashrc
#   .... some code already there in this file.
# add at the end
 
if [ -x /usr/bin/bash ] ; then
  SHELL=/usr/bin/bash ; export SHELL
fi
[ ! "$DT" ] && exec $SHELL

Open in new window

0
 
TintinCommented:
In your .profile, add:

[ -x /usr/bin/bash ] && exec /usr/bin/bash

Adjust the path above if needed to where bash is installed
0
 
Hanno P.S.IT Consultant and Infrastructure ArchitectCommented:
Tintin,
this is a short form of what I've already suggested -- unfortunately, it will not
propagate the changed shell's name to other programs that will get started
up later (like running a terminal window in X11 "xterm -ls ..."). They will still
use the former shell (or whatever has been put into the SHELL variable).

Cheers!
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now