Solved

Switching to Korn shell

Posted on 1998-08-03
6
527 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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…

759 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

24 Experts available now in Live!

Get 1:1 Help Now