How do I set my system to ksh

I installed RHEL 5.6 on my system.  It is strange, it uses bash as a default do not quite understan why

However, how do I set my system to ksh, permanently ?
Los Angeles1Asked:
Who is Participating?
 
woolmilkporcConnect With a Mentor Commented:
Hi,

for future users:

useradd -D -s /usr/bin/ksh

For existing users:

usermod -s /usr/bin/ksh userid

wmp
0
 
arnoldConnect With a Mentor Commented:
usermod -s /usr/bin/ksh username
This will modify the user's (reflected as username) from what it is to /usr/bin/ksh

useradd -D -s /usr/bin/ksh
To alter the default shell for future users.

0
 
woolmilkporcCommented:
Explanation:

The first command will modify the file /etc/default/useradd to set ksh as the default for newly created users.

The second command will modify /etc/passwd to set the shell for existing users.

useradd -D will display existing defaults.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
pilson66Connect With a Mentor Commented:
chsh /usr/bin/ksh
0
 
TintinCommented:
bash is the default on pretty much all Linux systems as most Linux distros don't include ksh in their default install.
0
 
TintinCommented:
Also, bash and ksh are 99% compatible, so there's really not a huge difference between the two unless you are using some very, very advanced/obscure features of ksh.
0
 
woolmilkporcCommented:
There's nothing obscure in ksh.

Perhaps Greensburo just doesn't like this old pipe/subshell problem (Remember? Reassigning variables using a pipe and e.g read?)

If his bash is <  4.2 not even the "shopt -s lastpipe" workaround is available.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.