Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Switching to Korn shell

Posted on 1998-08-03
6
Medium Priority
?
548 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 

Accepted Solution

by:
jpainter earned 200 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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 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.:
Suggested Courses

604 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