Setting the default shell without using chsh

I have tcsh being set as the default shell.I would like to change to ksh.

But i dont have "chsh" on my solaris box.so i added the following code to my ~/.login file

if ( -f /usr/bin/ksh) then
setenv SHELL /usr/bin/ksh
exec /usr/bin/ksh
endif

But this helps me to get the ksh,i doesnot seems to execute ~/.profile & ~/.kshrc files.

Note : I have added the ENV=~/.kshrc;export ENV line to my ~/.profile.

Please provide me your suggestions.

Thanks
Nagarajan Ganesan

What is your OS ? On Solaris for example you can use "passwd -e" - will change the shell.

I use SCO Openserver 5, and when I create a new user, the OS creates
an entry in the file /etc/passwd, which states what the default shell is.

Read up on adduser, and the passwd file, if your OS is similar!

Hi All,
I tried to use passwd -e & ypasswd -e but it doesnot allows me to change the shell(Permission denied).

Adding the below code to ~/.login file (My default shell is /usr/bin/tcsh) helps to me to get the korn shell.

if ( -f /usr/bin/ksh) then
setenv SHELL /usr/bin/ksh
exec /usr/bin/ksh
endif

Note: I don't have root access

Please provide in your thoughts.

Thanks in Advance,
Nagarajan G

HI All,
In my previous post i tried to exec the ksh,but it doesn't seems to execute the ~/.profile file.

Do we have any methods/options to exec so that we can tell the os to exec it as that of the login shell,thereby making the ksh to execute the ~/.profile .

Thanks
Nagarajan Ganesan

yes - all work must be done from "root".

Please refrain from bumping your posts the rules do not allow this.

I'm new to using the unix forum - when I reply, I just click on the top reply button. Did I get that wrong? Click on the bottom button?

Sorry not you coreysan, my comment was directed to ennstate. We posted at almost the same time and your post was not there when I started my reply.

Hi All,
I apologize for inconvienence caused. I got a solution this problem.

I created the following link,
ln -s /usr/bin/ksh ~/-ksh
And added the following lines to my ~/.login file,
if ( -f /usr/bin/ksh) then
       echo "Using Korn shell"
       setenv SHELL /usr/bin/ksh
       exec  -ksh
endif
This helps to me get a korn shell upon logging in and it also executes the ~/.profile 

Thanks 
Nagarajan Ganesan

I have the same problem, it almost works. However, can I see your .profile (or the relevant part of it)?