FACTOID # 141: Norwegians drink 10.7 kilograms of coffee per person each year. They also lead the globe in anxiety disorders. Maybe it’s time to switch to herbal tea.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

FACTS & STATISTICS    Simple view

  1. Select countries to view: (hold down Control key and click to select several)

     

     

    Compare:

     

     

  1. Select fact or statistic: (* = graphable)

     

     

     

  2. (OPTIONAL) Compare to statistic: (both need to be graphable)

     

     

     

  3. View result as:

     

       
(OR) SEARCH ALL encyclopedia, stats & forums:   

Encyclopedia > C shell

The C shell (csh) is a Unix shell developed by Bill Joy for the BSD Unix system. It was originally derived from the 6th Edition Unix /bin/sh (which was the Thompson shell), the predecessor of the Bourne shell. Its syntax is modeled after the C programming language. The C shell added many feature improvements over the Bourne shell, such as aliases and command history. Today, the original C shell is not in wide use on Unix; it has been superseded by other shells such as the Tenex C shell (tcsh) based on the original C shell code, but adding filename completion and command line editing, comparable with the Korn shell (ksh), and the GNU Bourne-Again shell (bash). An independently-developed and modernized C shell, created by Nicole Hamilton, also survives on Windows in the form of Hamilton C shell. Screenshot of a sample Bash session, taken on Gentoo Linux. ... Bill Joy (left) with Paul Saffo. ... Berkeley Software Distribution (BSD, sometimes called Berkeley Unix) is the Unix derivative distributed by the University of California, Berkeley, starting in the 1970s. ... Filiation of Unix and Unix-like systems Unix (officially trademarked as UNIX®) is a computer operating system originally developed in the 1960s and 1970s by a group of AT&T employees at Bell Labs including Ken Thompson, Dennis Ritchie and Douglas McIlroy. ... The Thompson shell was the first Unix shell, introduced in the first version of Unix in 1971, and was written by Ken Thompson. ... The Bourne shell, or sh, was the default Unix shell of Unix Version 7, and replaced the Thompson shell, whose executable file had the same name, sh. ... C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system. ... tcsh is a Unix shell based on and compatible with the C shell (csh). ... Korn shell logo. ... GNU (pronounced ) is a computer operating system - consisting of a kernel, libraries, system utilities, compilers, and end-user application software - composed entirely of free software. ... This article is about the UNIX shell named Bash. ...

Contents

Features

The C shell has the typical Unix shell structure: each line of input (or line of a script file) is interpreted as a separate command to execute, with backslashes "escaping" newlines where needed (so that multiple input lines can comprise a single command to be executed). First introduced in 1960 by Bob Bemer, the backslash, , is a typographical mark (glyph) used chiefly in computing. ...


New features

These features were first introduced in C shell, though most are now common to many Unix and Unix-like shells.

Job control 
The ability to suspend an interactive job and resume it at a later time, or send it into the "background".
History substitution 
The !-substitution feature allowed previous commands to be re-executed or edited in a variety of ways.
Arrays 
Variables could contain multiple elements, which could be numerically indexed.
~ expansion 
Home directory by username lookup, using ~ was popular enough that most modern, Unix-based Web servers now support it, in addition to most shells.
Aliases 
A command could be aliased to another command or command sequence.
Math operations 
Provided arithmetical operations which sh does not provide except by calling external programs.

Wikimedia servers architecture The term Web server can mean one of two things: A computer that is responsible for accepting HTTP requests from clients, which are known as Web browsers, and serving them HTTP responses along with optional data contents, which usually are Web pages such as HTML documents and... Arithmetic or arithmetics (from the Greek word αριθμός = number) is the oldest and most elementary branch of mathematics, used by almost everyone, for tasks ranging from simple daily counting to advanced science and business calculations. ...

Syntax differences

The most obvious difference between C shell and Bourne shell syntax was the use of parentheses for built-in conditional operations that Bourne shell called out to test for using square brackets (later versions of Bourne shell would rectify this by using a built-in test operator).


Variable assignment was also performed slightly differently with "set a = b" rather than Bourne shell's "a=b".


Criticism

While the C shell introduced many innovative features in interactive mode, the C shell's scripting capabilities came under criticism in the early-to-mid 1990s for their ambiguity, especially with respect to quoting and redirection. Combined with the fact that Bourne shell is guaranteed to be present on all Single UNIX Specification-compliant systems, sh is usually used for scripting purposes over C shell on Unix. This article is 150 kilobytes or more in size. ... The Single UNIX Specification (SUS) is the collective name of a family of standards for computer operating systems to qualify for the name Unix. The SUS is developed and maintained by the Austin Group, based on earlier work by the IEEE and The Open Group. ...


An example of possibly unwelcome behaviour of csh scripts is the following:

 if ( ! -e foo ) echo bar > foo 

It would appear to say "if file 'foo' does not exist, create it with contents 'bar'". But it will in fact create an empty file, as the line is parsed such that the output redirect is set up before the file existence is tested. (These and other criticisms do not, however, apply to the more-modern Hamilton C shell variant of the csh language.)


If scripts are written in csh, it is often useful to run the script with the -f flag, (e.g. by starting with the line #!/bin/csh -f) in order to avoid running the user's setup file as this may affect the script's behaviour.


Another known problem of csh is its message "0 event not found", which yields no information about what the problem was.


See also

tcsh is a Unix shell based on and compatible with the C shell (csh). ... Screenshot of a sample Bash session, taken on Gentoo Linux. ... This article or section does not cite its references or sources. ...

External links


  Results from FactBites:
 
UNIX shell differences and how to change your shell (Monthly Posting) (2225 words)
A brief history of UNIX shells Note, this history is just known to be slightly out of historical order, it is in the process of being corrected, but for the moment should be taken with a pinch of salt In the near beginning there was the Bourne shell /bin/sh (written by S. Bourne).
Into this shell they put several concepts which were new, (the majority of these being job control and aliasing) and managed to produce a shell that was much better for interactive use.
Like the Korn shell bash was based upon the Bourne shells language and like the Korn shell, it also pinched features from the C shell and other operating systems (in my opinion it put them together better; guess which shell I use), but unlike the Korn shell it is free.
The C Shell (1752 words)
The C shell was written by Bill Joy at the University of California at Berkeley.
The C shell handles job control, which allows the user to run certain programs in the background, and recall them to the foreground when necessary.
Shell scripts are programs written in C shell.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.