Home Man
Today's Posts

Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

Setting the default shell without using chsh


👤 Login 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

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

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.

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.

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

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 .

Nagarajan Ganesan
# 6  
Old 05-31-2007
Setting the default shell

yes - all work must be done from "root".
# 7  
Old 05-31-2007
Please refrain from bumping your posts the rules do not allow this.
👤 Login to reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
setting a shell script variable in awk guessingo Shell Programming and Scripting 2 09-06-2011 06:13 PM
Redirect STDOUT and STDERR of chsh austinharris43 Red Hat 1 03-22-2011 02:58 AM
setting a path in bash shell laura74 Shell Programming and Scripting 6 03-21-2010 08:54 AM
Setting Variable in TCL to be understood by KSH Shell kshitij Shell Programming and Scripting 1 03-19-2010 05:14 AM
[PHP] Setting a Superglobal from the Shell ? Neo Shell Programming and Scripting 0 12-06-2009 08:13 AM
Urgent help needed for ksh shell setting zing_foru UNIX for Advanced & Expert Users 6 11-04-2007 05:53 PM
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

All times are GMT -4. The time now is 03:40 PM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
Show Password