| ACADEMIC COMPUTING and COMMUNICATIONS CENTER | |||||||||
What UNIX Shell Are You Using? | ||||
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
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/cshWhen 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
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 |
|