Solved

How do I set my system to ksh

Posted on 2011-09-26
7
462 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
7 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 167 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 77

Assisted Solution

by:arnold
arnold earned 167 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 8

Assisted Solution

by:pilson66
pilson66 earned 166 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

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…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

773 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