Unix/Linux Go Back    


UNIX for Advanced & Expert Users 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

UNIX for Advanced & Expert Users


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 05-30-2007   -   Original Discussion by ennstate
ennstate's Unix or Linux Image
ennstate ennstate is offline
Registered User
 
Join Date: Mar 2007
Last Activity: 1 January 2015, 1:39 PM EST
Location: Stockholm
Posts: 230
Thanks: 1
Thanked 4 Times in 4 Posts
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
Sponsored Links
    #2  
Old Unix and Linux 05-30-2007   -   Original Discussion by ennstate
sysgate's Unix or Linux Image
sysgate sysgate is offline Forum Advisor  
Unix based
 
Join Date: Nov 2006
Last Activity: 17 November 2016, 5:32 AM EST
Location: Bulgaria
Posts: 1,420
Thanks: 0
Thanked 6 Times in 6 Posts
What is your OS ? On Solaris for example you can use "passwd -e" - will change the shell.
Sponsored Links
    #3  
Old Unix and Linux 05-30-2007   -   Original Discussion by ennstate
coreysan coreysan is offline
Registered User
 
Join Date: May 2007
Last Activity: 22 June 2009, 1:46 PM EDT
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
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 Unix and Linux 05-31-2007   -   Original Discussion by ennstate
ennstate's Unix or Linux Image
ennstate ennstate is offline
Registered User
 
Join Date: Mar 2007
Last Activity: 1 January 2015, 1:39 PM EST
Location: Stockholm
Posts: 230
Thanks: 1
Thanked 4 Times in 4 Posts
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
Sponsored Links
    #5  
Old Unix and Linux 05-31-2007   -   Original Discussion by ennstate
ennstate's Unix or Linux Image
ennstate ennstate is offline
Registered User
 
Join Date: Mar 2007
Last Activity: 1 January 2015, 1:39 PM EST
Location: Stockholm
Posts: 230
Thanks: 1
Thanked 4 Times in 4 Posts
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
Sponsored Links
    #6  
Old Unix and Linux 05-31-2007   -   Original Discussion by ennstate
coreysan coreysan is offline
Registered User
 
Join Date: May 2007
Last Activity: 22 June 2009, 1:46 PM EDT
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Setting the default shell

yes - all work must be done from "root".
Sponsored Links
    #7  
Old Unix and Linux 05-31-2007   -   Original Discussion by ennstate
reborg's Unix or Linux Image
reborg reborg is offline Forum Advisor  
Administrator Emeritus
 
Join Date: Mar 2005
Last Activity: 29 March 2012, 7:00 PM EDT
Location: Ireland
Posts: 4,464
Thanks: 0
Thanked 14 Times in 12 Posts
Please refrain from bumping your posts the rules do not allow this.
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Redirect STDOUT and STDERR of chsh austinharris43 Red Hat 1 03-22-2011 03:58 AM
[PHP] Setting a Superglobal from the Shell ? Neo Shell Programming and Scripting 0 12-06-2009 09:13 AM
Is this a shell setting problem? duke0001 Shell Programming and Scripting 7 02-20-2007 01:14 PM
Setting the shell FredSmith UNIX for Dummies Questions & Answers 3 07-20-2006 10:54 AM
Setting up shell variables rachael UNIX for Dummies Questions & Answers 1 10-22-2001 12:16 AM



All times are GMT -4. The time now is 07:02 PM.