Solved

Switching to Korn shell

Posted on 1998-08-03
6
534 Views
Last Modified: 2011-04-14
My user account is placed in the C-shell by default. I would like to have the Korn shell as my default shell. What file(s) need(s) to be modified and what commands are used?
0
Comment
Question by:rsorrent
6 Comments
 

Accepted Solution

by:
jpainter earned 50 total points
ID: 2009191
Go to smit
      Security and Users
      Users
      Change/show Characteristics of a user
Enter your user name
Then change the Initial Progrm to /bin/ksh

If you don't have adm or security privlages for users, then the Administrator will have to do this.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2009192
a general purpose UNIX solution (in addition to jpainter's AIX suggestion);

edit /etc/passwd, in the line containing your user account at the beginning, change the path to the login shell (currently /bin/ksh or similar) to your desires. The login shell is the last field in the line (fileds are seperated by colons).

0
 
LVL 5

Expert Comment

by:ecw
ID: 2009193
Or on BSD derived systems though pretty much on every SYSV, use chsh(1)
0
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.

 
LVL 1

Expert Comment

by:albberat
ID: 2009194

 There is a way to do this by not asking the System Administrator. If your shell is C you can switch to bash, and ksh(Korn Shell) simply by making some scripts at your home directory and you will log in the shell you want. Please post you UNIX flavor and I will gladly make a script for you(I have done the similar thing with switching from C to bash in Solaris 2.5.1 by using a script in .login). By the way such script for such thing is not more than 12 lines and usually as I far as I imagine that it should work virtually in every Unix flavor.
 
0
 
LVL 1

Expert Comment

by:albberat
ID: 2009195

 well, on Solaris to switch from CSH to KSH(Korn Shell) without letting the "root" do the following procedure. If your system is different from Solaris please post it to work out some details.

 Assumption: You have now an account(CSH -- C Shell)
 1) Make a hard link as follows:
 
 % ln -s /usr/bin/ksh ./-ksh
 (assumption: ksh is in /usr/bin/ksh -- find in your system)
 
 2) Add these lines in the top of the .cshrc file at home dir.

 setenv SHELL /usr/bin/ksh
 if ($?TERM) then
 cd
 exec -ksh
 else
 exec $SHELL
 endif
 echo "ERROR -- Unable to switch the shell to ksh"

 That is all. When you put those lines in  the top of your .cshrc you will be switched as in ksh in login despite the fact that you are assigned by system admin(root) to use csh.
 
 That is all. Good Luck.
 
0
 
LVL 1

Expert Comment

by:cyrusl
ID: 2009196
The easiest way to change your login shell (especially if you don't have root) is the "chsh" utility.  As far as I know, this utility is available on most platforms.  
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

Title # Comments Views Activity
sed -- search an replace multiple pattern 11 67
Using Grep to Find a file 8 85
Image not there 4 44
aix unix tar error 3 42
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
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 how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

912 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

16 Experts available now in Live!

Get 1:1 Help Now