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
 
The ADN Connection, November/December 1994 The A3C Connection
Nov/Dec 1994 Contents Moving Learning Online Getting Started with UNIX: Printing What UNIX Shell Are You Using Finding that Newsgroup: on CMS
Finding the Newsgroup: on UNIX More on Mail Expanding Your Disk Space About the ADN Connection  

What UNIX Shell Are You Using?

 
Tech Tip
UNIX Novice

The instructions in Getting Started in UNIX: Printing 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 tigger), and the C shell (csh). For example, enter: csh
to run the C-shell. Type: Ctrl-d to exit a shell. 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, it asks you to choose a new shell. For online information on the alternate shells, enter: on tigger: softlist, or on icarus: softlist

Then select "Utilities, Servers, and Alternate Shells."

 
 

The ADN Connection, Nov/Dec 1994 Previous: Getting Started with UNIX: Printing Next: Finding that Newsgroup: on CMS


1999-9-2  connect@uic.edu
UIC Home Page Search UIC Pages Contact UIC