Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

making bash as default shell 1

Status
Not open for further replies.

hok1man

Technical User
Feb 16, 2008
102
Hi guys,

I have put in my ~/.profile

bash.
and I have put
. ~/.bashrc

but still my default shell is csh, i know it's from the root. and my ~/.bashrc is still empty.

any idea how to make bash as default?

thanks guys
 
Modify the user to have bash as the shell.

usermod -s /usr/bin/bash <username>

 
as I dont think I have privilledge to do that..
can I use somewhere in .profile?

I tried it some way but doesn't work..
can you guys shed some light about this?
 
If your shell is csh, .profile isn't used if I'm not mistaken... See if you have a [tt]~/.login[/tt] file or a [tt]~/.cshrc[/tt] where you can invoke [tt]bash[/tt] from. But it won't be the same because I don't think any [tt]~/.bashrc[/tt] file will be read. See if invoking [tt]bash -i[/tt] from [tt]~/.login[/tt] or [tt]~/.cshrc[/tt] helps in this case.


HTH,

p5wizard
 
Can you not just ask the sys admin to do this for you?
It's not a big ask.
Alternatively live with it and type bash at every logon.
 
Hi hok1man,

Try adding bash as the very last line in the .profile Save the file and dot it in and see what happens.

Good Luck
DrD
 
Some operating systems have a chsh command which allows users to select a different shell. The choice is normally restricted to the list of shells in /etc/shells.

Annihilannic.
 
Don't just put [tt]bash[/tt] as the last line in your [tt].login[/tt]. It would be cleaner to add this...
Code:
exec /bin/bash --login
Put that as the only line in your [tt].login[/tt] file and then set up the proper [tt].profile[/tt] and [tt].bashrc[/tt] files for bash.

The [tt]exec[/tt] replaces the [tt]csh[/tt] process with [tt]bash[/tt], so your bash session doesn't have a csh parent session. A little cleaner IMHO, and you don't have to log out twice.

The best way is to get it changed in [tt]/etc/passwd[/tt].
 
Thanks guys,

I figured it out...
I need to put in .login this


if ( -f /usr/bin/bash ) exec /usr/bin/bash --login


But I got another question customizing alias in another thread please help me guys :)
 

Take a star, too, hok1man, for sharing your solution which was just handy for me. [smile]


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top