Setting the default shell without using chsh


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Old 05-30-2007
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

Code:
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
# 2  
Old 05-30-2007
What is your OS ? On Solaris for example you can use "passwd -e" - will change the shell.
# 3  
Old 05-30-2007
Changing the default 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!
# 4  
Old 05-31-2007
Changing shell passwd -e

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.

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

Quote:
Problem with this is it doesnot execute the ~/.profile.
Note: I don't have root access

Please provide in your thoughts.


Thanks in Advance,
Nagarajan G
# 5  
Old 05-31-2007
How to exec the shell.

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
# 7  
Old 05-31-2007
Please refrain from bumping your posts the rules do not allow this.
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Shell Script for Setting Env Variables PavanPatil Shell Programming and Scripting 1 01-31-2014 02:45 AM
Setting permissions for shell scripts jayadrath UNIX for Advanced & Expert Users 4 11-28-2011 07:34 AM
tcsh env setting using shell script ajaincv Shell Programming and Scripting 1 07-28-2011 05:05 AM
Redirect STDOUT and STDERR of chsh austinharris43 Red Hat 1 03-22-2011 02:58 AM
Probelm setting a variable to $* in C Shell kristinu Shell Programming and Scripting 2 09-05-2010 10:31 AM
Setting environment variable using shell script arun_maffy Shell Programming and Scripting 6 07-07-2010 08:49 AM
Need help on setting up New shell script for sending SMS vpraveenn Shell Programming and Scripting 3 05-31-2010 05:58 PM
setting a path in bash shell laura74 Shell Programming and Scripting 6 03-21-2010 08:54 AM
[PHP] Setting a Superglobal from the Shell ? Neo Shell Programming and Scripting 0 12-06-2009 08:13 AM
Exit shell after setting executable to run? pcwiz Shell Programming and Scripting 1 08-25-2009 04:08 PM
problem in setting classpath in shell script sari Shell Programming and Scripting 1 04-16-2008 08:40 AM
Is this a shell setting problem? duke0001 Shell Programming and Scripting 7 02-20-2007 12:14 PM
Setting value of Shell variable from within ISQL tipsy Shell Programming and Scripting 3 08-29-2006 07:23 PM
Setting the shell FredSmith UNIX for Dummies Questions & Answers 3 07-20-2006 09:54 AM
Setting up shell variables rachael UNIX for Dummies Questions & Answers 1 10-21-2001 11:16 PM