ACCC Home Page ACADEMIC COMPUTING and COMMUNICATIONS CENTER
Accounts / Passwords Email Labs / Classrooms Telecom Network Security Software Computing and Network Services Education / Teaching Getting Help
 

What UNIX Shell Are You Using?

 

For online information on the alternate shells on each ACCC UNIX machine, enter: on tigger: softlist, or on icarus: softlist and then select "Utilities, Servers, and Alternate Shells."

 
   
 
     
Introduction
 

The instructions in Getting Started in UNIX: Printing and the other ACCC basic UNIX documentation assume you're using the Korn shell. Don't know whether you are, or even what that means? Here's a brief introduction to UNIX shells. 

The shell is UNIX's command interpreter. It waits patiently for you to type a command, then figures out what you want to do. It either performs the action itself, or more likely will find and launch whatever you asked for. The shell takes care of finding your commands in the proper directory, maintaining your custom environment, interpreting command-line wildcards, and maintaining a history of your commands for editing and recall.

One of the UNIX's strengths is that the operating system is not tied to a particular shell. In fact, in UNIX, the shell itself is a program that you execute like any other program.

Most UNIX systems know of at least three shells:

  • the Bourne shell (sh)
  • the Korn shell (ksh, the default login shell on all ACCC UNIX machines)
  • the C shell (csh).

For example, enter: csh

to run the C-shell.

Type: Ctrl-d to exit a shell. Note that your "login shell" is automatically started for you when you login; using Ctrl-d to exit it will log you out.

Most shells understand a fairly extensive "scripting" language. It's this property that allows you to collect a bunch of commands in a file, use chmod to make it executable, and execute it by entering its name on the command line.

One annoying thing about UNIX's having multiple shells is that a shell script written for one shell usually won't work if executed under another shell. Thus, if you usually run ksh, but your friend sends you a script designed to work with csh, you must remember to explicitly run csh before you run the script. An elegant way to get around this is to specify the script's shell in the script itself, by making its first line a special type of comment:

#!/bin/csh

When you execute the script, your shell (whatever it might be) will "spawn" /bin/csh for it.
 
     
Is your command prompt a $?
 

The $ is the default prompt for the Korn shell; you're probably using it. Is it a %? Then you're probably using C shell; the % is its default prompt.

 
     
Want to change your login shell?
 

Enter: chsh
chsh lists the available shells, tells you what your login shell is, and asks whether you want to change it.

If you answer yes, chsh asks you to choose a new shell.

For information on the alternate shells on ACCC UNIX, see tigger's softlist or icarus's softlist.

 


2004-2-18  ACCC documentation
UIC Home Page Search UIC Pages Contact UIC