csh

From NetBSD Wiki

Jump to: navigation, search
This article is a stub. You can help by editing it.

The C shell, aka csh(1), is a historical shell that originated with BSD. In older releases (1.6 and earlier), this was the default shell in NetBSD (in newer releases, the installer prompts for the shell to use). The C shell is the only non-POSIX shell available in NetBSD, and one may not assume that it will be available on all Unix machines. It is very ubiquitous, however, so it will be very hard to find a system that does not have it.

It is called C shell because it has a syntax that is very similar to C. This means C programmers will feel right at home using it for scripting. This does make it very odd to use for people who are more used to bourne shells, because everything is done in a slightly different way. Not so different that it is immediately apparent which things are actually different and which aren't unless you read the manpage.

There are many pretty fundamental problems with the C shell, as described in [1], but the C shell also fixes one of the most important deficiencies of the bourne shell (sh): it can handle arrays. One of the most well-known problems with the bourne shell is that arrays or lists are simply strings where the different elements are separated by spaces only. This causes various problems when it concerns filenames or string arguments with spaces in them.

The csh implementation in NetBSD is extremely basic, even more than most programs under NetBSD. For real tabcompletion (NetBSD's csh has escape-completion/^D-completion), history browsing and commandline editing, have a look at shells/tcsh.

See also

  • sh, the Bourne shell
  • ksh, the Korn shell

References

Retrieved from "http://wiki.netbsd.se/csh"
Personal tools