Solved

How do I set my system to ksh

Posted on 2011-09-26
7
461 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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now