Solved

Switching to Korn shell

Posted on 1998-08-03
6
539 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
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.

776 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