Shell Scripting
Description
On UNIX-like systems, the shell is the command interpreter used for executing commands during a terminal session and for running scripts. There are many different shells available providing different combinations of features. They can be classified according to the syntax they accept into two main families:
- the Bourne Shell and its descendants, which include the GNU Bourne Again Shell (
bash
), the Korn Shell (ksh
), the Z Shell (zsh
) and the Almquist Shell (ash
or the Debian implementationdash
); and - the C Shell (
csh
), and its descendant the TENEX C Shell (tcsh
).
On each system there is a default shell for use by scripts and an initial login shell for each user. POSIX defines the minimal behaviour required of the default shell, and scripts which seek to be portable should avoid relying on behaviour outside of this subset.
microHOWTOs
- Act on all files in a directory tree using find
- Act on all files in a directory tree using find and xargs
- Add a directory to the current path
- Convert a text file from one character encoding to another
- Convert leading spaces to tabs in a text file
- Convert the line endings in a text file from DOS to UNIX format
- Convert the line endings in a text file from UNIX to DOS format
- Copy a file from one machine to another using Netcat
- Create a file filled with zeros
- Display the size of a Linux block special device
- Display the value of an environment variable
- Persistently set the value of an environment variable for a given user
- Persistently set the value of an environment variable for all users
- Set the value of an environment variable
Further reading
- sh - shell, the standard command language interpreter, Base Specifications, Issue 7, The Open Group, 2008
- UNIX shell differences and how to change your shell (USENET FAQ)
- Bash (official website)
- KornShell (official website)
- Zsh (official website)
- Ash (Almquist Shell) Variants
- DASH (official website)
- William Joy, An Introduction to the C Shell
- TCSH: Home (official website)