C shell

[2][3] Other early contributors to the ideas or the code were Michael Ubell, Eric Allman, Mike O'Brien and Jim Kulp.

Like all Unix shells, it supports filename wildcarding, piping, here documents, command substitution, variables and control structures for condition-testing and iteration.

[9] Because it only added functionality and did not change what already existed, tcsh remained backward compatible[10] with the original C shell.

tcsh is very stable but new releases continue to appear roughly once a year, consisting mostly of minor bug fixes.

The square bracketed condition had to be evaluated by the slower means of running the external test program.

If the child exited with a zero return code, sh would look for a then clause (a separate statement, but often written joined on the same line with a semicolon) and run that nested block.

sh's use of a reversed keyword to mark the end of a control block was a style borrowed from ALGOL 68.

It also claimed better readability: Its expressions used a grammar and a set of operators mostly copied from C, none of its keywords were reversed and the overall style was also more like C. Here is a second example, comparing scripts that calculate the first 10 powers of 2.

It introduced numerous new features that made it easier, faster and more friendly to use by typing commands at a terminal.

The most significant of these new features were the history and editing mechanisms, aliases, directory stacks, tilde notation, cdpath, job control, and path hashing.

History allows users to recall previous commands and rerun them by typing only a few quick keystrokes.

Operators range from simple string search/replace to parsing a pathname to extract a specific segment.

Tilde notation offers a shorthand way of specifying pathnames relative to the home directory using the "~" character.

The escape key can be used interactively to show possible completions of a filename at the end of the current command line.

Well into the 1980s, most users only had simple character-mode terminals that precluded multiple windows, so they could only work on one task at a time.

That table can usually tell the C shell where to find the file (if it exists) without having to search and can be refreshed with the rehash command.

Each line is tokenized into a set of words separated by spaces or other characters with special meaning, including parentheses, piping and input/output redirection operators, semicolons, and ampersands.

Since version 6.17.01, recursive wildcarding à la zsh (e.g. "**/*.c" or "***/*.html") is also supported with the globstar option.

However, the decision relied on Unix's ability to pass long argument lists efficiently through the exec system call that csh uses to execute commands.

Although modern Windows can pass command lines of up to roughly 32K Unicode characters, the burden for wildcard interpretation remains with the application.

Quoting mechanisms allow otherwise special characters, such as whitespace, wildcards, parentheses, and dollar signs, to be taken as literal text.

The long form uses then, else and endif keywords to allow for blocks of commands to be nested inside the condition.

If the else and if keywords appear on the same line, csh chains, rather than nests them; the block is terminated with a single endif.

Although Stephen Bourne himself acknowledged that csh was superior to his shell for interactive use,[15] it has never been as popular for scripting.

[16] Initially, and through the 1980s, csh could not be guaranteed to be present on all Unix and Unix-like systems, but sh could, which made it a better choice for any scripts that might have to run on other machines.

However, by practicing, it's possible to overcome those deficiencies (thus instructing the programmer to take better and safer approaches on implementing a script).

(Since tcsh was based on the csh code originally written by Bill Joy, it is not considered a clone.)

Companion diskettes containing full source for SH and for a basic set of Unix-like utilities (cat, cp, grep, etc.)

The control structures, expression grammar, history mechanism and other features in Holub's SH were identical to those of the C shell.

Hamilton also added new language features including built-in and user-defined procedures, block-structured local variables and floating point arithmetic.

C Shell running on Windows Services for UNIX
64-bit Hamilton C shell on a Windows 7 desktop.