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:

for future users:

useradd -D -s /usr/bin/ksh

For existing users:

usermod -s /usr/bin/ksh userid

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.


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.
Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

pilson66Connect With a Mentor Commented:
chsh /usr/bin/ksh
bash is the default on pretty much all Linux systems as most Linux distros don't include ksh in their default install.
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.
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.
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.