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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
Due to network maintenance being performed by our provider, LQ will be down starting at 05:01 AM UTC. The exact duration of the downtime isn't currently known. We apologize for the inconvenience.
|
 |
04-19-2006, 04:54 PM
|
#1
|
|
Member
Registered: Apr 2006
Posts: 49
Rep:
|
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
|
|
|
|
04-19-2006, 05:06 PM
|
#2
|
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 13.37
Posts: 4,084
Rep: 
|
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.
|
|
|
|
04-19-2006, 05:08 PM
|
#3
|
|
Member
Registered: Apr 2006
Posts: 49
Original Poster
Rep:
|
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.
|
|
|
|
04-19-2006, 05:32 PM
|
#4
|
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 13.37
Posts: 4,084
Rep: 
|
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.
|
|
|
|
04-19-2006, 08:43 PM
|
#5
|
|
Member
Registered: Apr 2006
Posts: 49
Original Poster
Rep:
|
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.
|
|
|
|
04-19-2006, 10:21 PM
|
#6
|
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 13.37
Posts: 4,084
Rep: 
|
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...
|
|
|
|
04-20-2006, 06:55 PM
|
#7
|
|
Member
Registered: Apr 2006
Posts: 49
Original Poster
Rep:
|
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
|
|
|
|
04-20-2006, 07:03 PM
|
#8
|
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 13.37
Posts: 4,084
Rep: 
|
No problem - glad it's working... 
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 05:42 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|