How can I change my default shell

hi ;
Right now my default shell on our school system is :
/bin/ksh

but i want to change it to another shell. There is also bash shell installed in the system as : /bin/bash

So, how can I change my default shell to bash shell? Or maybe any other shell?

the command you want is "chsh", but you might not have the requisite permissions to change it, depending on the system or the local policy.

You could also just change your .profile to execute /bin/bash if chsh doesn't work.

Once changing your shell with `chsh' ensure you `su' to yourself to see if the changes are successful. Otherwise you mat find yourself locked out.

i never knew about chsh. i always just edited /etc/passwd

yeah, but you can not edit that file unless you have administrator privilage.

By the way, chsh command is not recognized by my system...

If you're using solaris passwd -e will change your login shell. Which OS are you using?

Cheers
ZB

this is the message I get when I login to the system :

Sun Microsystems Inc.   SunOS 5.9       Generic May 2002

passwd -e command does not work either, I think passwd command is locked for the users, because it gives a brief message when I type the passwd command on shell.

usermod -s <the shell desired by you> username
can help you if only you have admin rights

ok, i figured out another way :
I put a /bin/bash statement at the beginning of the .profile file, so each time I login to system my shell is bash shell. However, it does not recognize my other aliases and some other statements in the same file anymore...

And, the OS is Solaris 9.

That's because the file (.profile) is only read by your login shell, not the bash shell you launch from .profile. You can place your aliases, functions, etc, in $HOME/.bashrc.

Cheers
ZB

Is that b/c you actually read all of the first reply to your question? :wink:

or put

/bin/bash -l

causing bash to be started as a login shell. it will read from .profile now.

Doesn't that cause infinite recursion?

Not infinite. Eventually you would not be able to fork.

I would create a .bash_profile file first. If that file exists, bash will read it and ignore .profile. Then I would run "bash -l" by hand to be sure that this looked good. Finally I would add:
exec /bin/bash -l
into my .profile. By using exec, no fork will occur. ksh will simply overlay itself with bash.

By saying /bin/bash -l , I think you meant --login option, because I am not sure there is a -l option for /bin/bash.

User Commands                                             BASH(1)
--login
          Make bash act as if it had  been  invoked  as  a  login
          shell (see INVOCATION below).

And --login option, as mentioned above by anarchie, causes recursion, so it keeps printing login message, but never does actually login.

thanks anyways for all your suggestions, I did as norsk hedensk suggested and so far it works fine except, it runs at least 2 processes all the time when I am logged in : the ksh and the bash :

UID  PID    PPID   C    STIME       TTY     TIME    CMD
me  18264  18258   0   20:04:57     pts/1    0:00   -ksh
me  18286  18264   0   20:05:02     pts/1    0:00   /bin/bash
me  18687  18286   0   20:14:01     pts/1    0:00   ps -af

peace...

That's b/c you didn't really change your shell (because your local sysadmin wouldn't let you). So you're really running a virtual bash inside ksh (someone will correct me if that's not the correct nomenclature). You'll also have to hit CTRL-D twice to exit, or type "exit" two times to truly exit. A minor inconvenience.

your could stop infinite recursion by testing the $SHELL variable. IOnly invofe the bash shell if you are currently NOT in the bash shell.

long option, short option. same thing. use whatever you have.