C Shell Command Line
This section provides a quick introduction of C shell command line.
The C shell is really a command line interface that takes a command line entered by the user
on the standard input, execute the command, and returns command result on the standard output.
A command line consists of a list of strings or words. The first word is called the command name.
Other words of the command line are called command arguments.
A number of interesting features are supported on the C shell command line.
Those features are applied in the following order before the command line gets executed:
- History Substitution - Brings in parts of previously executed commands.
- Alias Substitution - Replaces user defined aliases with their definitions.
- I/O Redirection - Changes input and/or output from terminal console to other commands or files.
- Variable Substitution - Replaces shell variables with their values.
- Command Substitution - Replaces commands with their outputs.
- Filename Substitution - Replaces filename wildcard characters with real file names.
After a command line is passed through above substitutions, it will be executed in different ways
based on the command name, the first word of the command line:
- If the command name refers to a C shell built in command, the C shell will execute this command.
- If the command name refers to a file name with a path name, the C shell will execute the program represented by the path name
- If the command name refers to a file name without any path name, the C shell will search the file name
in the directories defined in the "path" variable.
- If the above process fails, the C shell will return an error.
Examples of C shell command lines:
%set java home=/usr/local/lib/jdk1.1.1
%/bin/echo $java home
%/echo $java home
herong tty1 Jul 21 21:36
tom tty2 Jul 21 18:15
dothis: Command not found.
Table of Contents
About This Book
1957 - FORTRAN Language Developed by IBM
1970 - UNIX Operating System Developed by AT&T Bell Labs
1971 - FTP Protocol Created by Abhay Bhushan
1972 - C Language Developed by Dennis Ritchie
1976 - vi Text Editor Developed by Bill Joy
1977 - Apple II Designed by Steve Jobs and Steve Wozniak
1977 - The Bourne Shell Developed by Stephen Bourne
►1978 - The C Shell Developed by Bill Joy
What Is the C Shell?
►C Shell Command Line
Command Line History Substitution
Command Line Alias Substitution
Command Line Input and Output Redirection
Command Line Variable Substitution
C Shell Command Line Examples
".cshrc" - C Shell Script File and
1978 - Bash (Bourne-Again Shell) Developed by Brian Fox
1979 - The Tcsh (TENEX C Shell) Developed by Ken Greer
1983 - "Sendmail" Mail Transfer Agent Developed by Eric Allman
1984 - Macintosh Developed by Apple Inc.
1984 - X Window System Developed a MIT Team
1991 - WWW (World Wide Web) Developed by Tim Berners-Lee
1991 - Gopher Protocol Created by a University of Minnesota Team
1995 - Java Language Developed by Sun Microsystems
1995 - PHP: Hypertext Preprocessor Created by Rasmus Lerdorf
2002 - .NET Framework Developed by Microsoft
PDF Printing Version