?
Solved

How do I set my system to ksh

Posted on 2011-09-26
7
Medium Priority
?
474 Views
Last Modified: 2013-11-17
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 ?
0
Comment
Question by:Los Angeles1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 668 total points
ID: 36601311
Hi,

for future users:

useradd -D -s /usr/bin/ksh

For existing users:

usermod -s /usr/bin/ksh userid

wmp
0
 
LVL 79

Assisted Solution

by:arnold
arnold earned 668 total points
ID: 36601338
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
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 36601345
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
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
LVL 8

Assisted Solution

by:pilson66
pilson66 earned 664 total points
ID: 36601420
chsh /usr/bin/ksh
0
 
LVL 48

Expert Comment

by:Tintin
ID: 36601671
bash is the default on pretty much all Linux systems as most Linux distros don't include ksh in their default install.
0
 
LVL 48

Expert Comment

by:Tintin
ID: 36601675
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
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 36601787
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

Featured Post

Docker-Compose to Simplify Multi-Container Builds

Our veteran DevOps Author takes you through how to build a multi-container environment, managed with a single utility in order to simplify your deployments.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month9 days, 23 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question