LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 04-19-2006, 04:54 PM   #1
johnsanty
Member
 
Registered: Apr 2006
Posts: 49

Rep: Reputation: 15
Why I can't change my Shell from bash to any other shells I have.


Hi All,

This is my first post...

I just recenly installed Red Hat Linux 9 and by default my shell is set to bash. I wanted to change it to csh or to any other shell I have but unfortunately it cannot be changed. Here's some info:

1)I have verified that I have different shells installed in my system. I have the list of shells such as csh,sh, etc...

2) Then I tried to change my shell from "bash" to "sh" by following the procedure:

#chsh
<then it prompted me to enter the type of the shell I wanted to change it to>


It seemed successful since there was no error, but when I checked my present shell by running the following command:

#echo $SHELL

Unfortunately, it showed the same shell, that is, bash.
Could somebody help me with this? Do I have to install any package?

My second concern is that I dont have ksh shell in my list of shells. What do I have to install in order to have ksh shell.

Thank you in advance. I really appreciate your help.

John
 
Old 04-19-2006, 05:06 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
When you verified that you had the other shells installed on your system, did you also confirm that they were listed in /etc/shells? Normally only root can change someone's login shell to a value not listed there.
 
Old 04-19-2006, 05:08 PM   #3
johnsanty
Member
 
Registered: Apr 2006
Posts: 49

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by gilead
When you verified that you had the other shells installed on your system, did you also confirm that they were listed in /etc/shells? Normally only root can change someone's login shell to a value not listed there.
Hi gilead,

Thanks for you prompt reply. Yes, I did that. Actually, the command that I used was

#cat /etc/shells

The it showed my list of shells.
 
Old 04-19-2006, 05:32 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
OK, did you type echo $SHELL straight after using the chsh command? If so, then it wouldn't work. You need to open a new login shell and that one will use the new shell setting.

For ksh, it's normally a separate package. You don't say which distribution that you're using. Does which ksh return anything? If not, then you need to install the ksh package from your install CDs.

Also, If you'd like to change your shell in the current session, just type the shell name. For example: /bin/tcsh

Last edited by gilead; 04-19-2006 at 05:37 PM.
 
Old 04-19-2006, 08:43 PM   #5
johnsanty
Member
 
Registered: Apr 2006
Posts: 49

Original Poster
Rep: Reputation: 15
Hi gilead,

Thanks for the prompt reply...


OK, did you type echo $SHELL straight after using the chsh command? If so, then it wouldn't work. You need to open a new login shell and that one will use the new shell setting.

Ans:
I tried what you said to open a new shell prompt but it failed. Just to clarify is opening a new shell prompt is the same as opening a new login shell? Please find the results below:

Before the shell is changed:
[<username>@<computername> <username>]$ echo $SHELL
/bin/bash
[<username>@<computername> <username>]$

When the shell is being changed:
[<username>@<computername> <username>]$ chsh
Changing shell for <username>.
Password:
New shell [/bin/bash]: /bin/csh
Shell changed.
[<username>@<computername><username>]$
[<username>@<computername> <username>]$

When I checked if the new shell is set up from a new shell prompt.
The shell hasn't beend changed.
[<username>@<computername> <username>]$ echo $SHELL
/bin/bash
[<username>@<computername><username>]$

But when I tried to change the shell back to bash, it shows that it will be changed
from csh.

[<username>@<computername> <username>]$ chsh
Changing shell for <username>.
Password:
New shell [/bin/csh]:




For ksh, it's normally a separate package. You don't say which distribution that you're using. Does which ksh return anything? If not, then you need to install the ksh package from your install CDs.

Ans.
Ok..I apologize for revealing my distribution. Here's the result when I tried to change the shell to ksh.

[<username>@<computername> <username>]$ /bin/ksh
bash: /bin/ksh: No such file or directory
[<username>@<computername> <username>]$


Also, If you'd like to change your shell in the current session, just type the shell name. For example: /bin/tcsh[/QUOTE]

Thank you so much..I really appreciate your reactivity. Thanks in advance.

John.
 
Old 04-19-2006, 10:21 PM   #6
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
Hi John, the chsh command alters the entry in /etc/passwd where your default shell is recorded. If your username was john, typing grep '^john' /etc/passwd after using chsh will show you the changed value. It's correct that after issuing the chsh command the shell used in your current session does not change.

If you logout then login again, the changed shell will be used (e.g. /bin/tcsh).

I hope that helps - I'm in and out of meetings today so I'm just scanning posts as I go...
 
Old 04-20-2006, 06:55 PM   #7
johnsanty
Member
 
Registered: Apr 2006
Posts: 49

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by gilead
Hi John, the chsh command alters the entry in /etc/passwd where your default shell is recorded. If your username was john, typing grep '^john' /etc/passwd after using chsh will show you the changed value. It's correct that after issuing the chsh command the shell used in your current session does not change.

If you logout then login again, the changed shell will be used (e.g. /bin/tcsh).

I hope that helps - I'm in and out of meetings today so I'm just scanning posts as I go...
Hi gilead,

thanks for the reply. here's what i did:
I changed my shell using chsh then I logged in again by typing su - username and it worked. i'll try your way as indicated above. thank you so much for your help...

john
 
Old 04-20-2006, 07:03 PM   #8
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
No problem - glad it's working...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change the default shell to bash? shadkong Slackware 12 04-23-2005 03:49 PM
Bash and login shells Adrohak Linux - Software 3 11-18-2004 10:21 AM
Is this a bug? (BASH and Z shells) KingofBLASH Linux - Software 4 09-14-2004 06:14 PM
how change text (and background) color within the bash shell? Xavius Linux - Newbie 4 03-29-2004 02:21 PM
bash and other linux shells crealkiller175 Linux - General 9 03-02-2003 03:02 PM


All times are GMT -5. The time now is 09:19 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration