LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 06-13-2007, 10:00 PM   #1
tejpatil
Member
 
Registered: Feb 2004
Posts: 43

Rep: Reputation: 15
How to switch from BASH to KSH?


How to switch from bash to ksh?

Thanks,
TJ
 
Old 06-13-2007, 10:10 PM   #2
vtel57
Member
 
Registered: Jul 2006
Location: Tampa, FL, USA
Distribution: Slackware (primary), Arch (secondary)
Posts: 734

Rep: Reputation: 78
You can use the "chsh" command.

Code:
$ man chsh
http://www.linuxcommand.org/man_pages/chsh1.html
 
Old 06-13-2007, 10:18 PM   #3
tejpatil
Member
 
Registered: Feb 2004
Posts: 43

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by vtel57
You can use the "chsh" command.

Code:
$ man chsh
http://www.linuxcommand.org/man_pages/chsh1.html
Thanks a lot. I will try it.

TJ
 
Old 06-13-2007, 10:20 PM   #4
infidel
Member
 
Registered: Jun 2003
Location: Easley, SC, US
Distribution: Ubuntu 7.10, Mandrake 9.2
Posts: 91

Rep: Reputation: 15
Here's another how-to:

http://jamesthornton.com/writing/cha...gin-shell.html

If you're just wanting to run the shell temporarily (instead of making it your default), I'm pretty sure it's as simple as making sure you have the desired shell installed, then running it from the command line of your existing shell (works for me under NetBSD, anyway; never had the desire to switch shells in Linux). The 'exit' command should take you back to the default.
 
Old 06-13-2007, 10:28 PM   #5
tejpatil
Member
 
Registered: Feb 2004
Posts: 43

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by infidel
Here's another how-to:

http://jamesthornton.com/writing/cha...gin-shell.html

If you're just wanting to run the shell temporarily (instead of making it your default), I'm pretty sure it's as simple as making sure you have the desired shell installed, then running it from the command line of your existing shell (works for me under NetBSD, anyway; never had the desire to switch shells in Linux). The 'exit' command should take you back to the default.
Thanks.

After I switch to ksh can I start writing the shell scripting and execute this, does this work?

Thanks,
TJ
 
Old 06-13-2007, 10:29 PM   #6
vtel57
Member
 
Registered: Jul 2006
Location: Tampa, FL, USA
Distribution: Slackware (primary), Arch (secondary)
Posts: 734

Rep: Reputation: 78
Actually, that's a pretty good how-to. I have that bookmarked. I should have linked it in my first post here. I forgot. Thanks, infidel!
 
Old 06-13-2007, 10:33 PM   #7
tejpatil
Member
 
Registered: Feb 2004
Posts: 43

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by tejpatil
Thanks.

After I switch to ksh can I start writing the shell scripting and execute this, does this work?

Thanks,
TJ

Thanks for the info, its very useful. Also is there any way to find which shell Iam using.
 
Old 06-13-2007, 10:48 PM   #8
vtel57
Member
 
Registered: Jul 2006
Location: Tampa, FL, USA
Distribution: Slackware (primary), Arch (secondary)
Posts: 734

Rep: Reputation: 78
Code:
$ echo $SHELL
Example from my terminal:

Quote:
vtel57@ericsbane03:~$ echo $SHELL
/bin/bash
 
Old 06-13-2007, 10:58 PM   #9
tejpatil
Member
 
Registered: Feb 2004
Posts: 43

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by vtel57
Code:
$ echo $SHELL
Example from my terminal:

Hi vtel57,

I did the following and changed the shell, but when I tried to find which shell I am using it gives back /bin/bash, please see below.

$ chsh
Changing shell for db2admin.
Password:
New shell [/bin/bash]: /bin/ksh
Shell changed.
$ echo $SHELL
/bin/bash
$


Thanks,
TJ
 
Old 06-13-2007, 10:59 PM   #10
tejpatil
Member
 
Registered: Feb 2004
Posts: 43

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by tejpatil
Hi vtel57,

I did the following and changed the shell, but when I tried to find which shell I am using it gives back /bin/bash, please see below.

$ chsh
Changing shell for db2admin.
Password:
New shell [/bin/bash]: /bin/ksh
Shell changed.
$ echo $SHELL
/bin/bash
$


Thanks,
TJ

Its should give /bin/ksh instead of /bin/bash. Is this correct?
 
Old 06-13-2007, 11:15 PM   #11
vtel57
Member
 
Registered: Jul 2006
Location: Tampa, FL, USA
Distribution: Slackware (primary), Arch (secondary)
Posts: 734

Rep: Reputation: 78
User logout... log back in.
 
Old 06-14-2007, 11:01 AM   #12
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS, Linux Mint , Solaris 10
Posts: 1,578
Blog Entries: 1

Rep: Reputation: 81
Try

Code:
yum -y install ksh
 
Old 06-14-2007, 12:50 PM   #13
vtel57
Member
 
Registered: Jul 2006
Location: Tampa, FL, USA
Distribution: Slackware (primary), Arch (secondary)
Posts: 734

Rep: Reputation: 78
Er... yeah. I was assuming you had ksh already installed. If not, use custangro's suggestion.

Luck!
 
Old 06-14-2007, 02:03 PM   #14
dawkcid
Member
 
Registered: May 2007
Location: UK
Distribution: LFS,Slackware,Slamd64,NetBSD
Posts: 102

Rep: Reputation: 15
Quote:
New shell [/bin/bash]: /bin/ksh
Shell changed.
It must be installed otherwise it wouldn't be listed in /etc/shells and you wouldn't be able to chsh.

As vtel57 said, you need to log out and back in.
 
  


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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I install KSH on Fedora 7 which already has bash on it tejpatil Linux - Software 4 06-14-2007 10:48 AM
bash or ksh noir911 *BSD 5 05-10-2007 11:08 AM
bash more bloated than ksh? noir911 Linux - General 4 10-10-2006 04:58 PM
bash/ksh variables question tpe Programming 2 08-11-2005 09:39 AM
ksh commands in bash nkelle Linux - General 2 11-13-2003 11:11 AM


All times are GMT -5. The time now is 12:33 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
Open Source Consulting | Domain Registration