One of the powerful things about Unix is the extensive use ofprogrammable shells, that is, programs (that arenot part of the operating system kernel) thatallow you to run programs and see their output. This wasn't a newinnovation with Unix; the notion of having a replaceable"command shell" rather than a"monitor"tightly integrated with the OS kernel tends to be attributed to Multics.
In any case, the notion of having a powerful, programmable"shell" to allow you to control your environment has ledto a proliferation of increasingly powerful shells.
The traditional Unix shell from the very early days. Unix folk need to have some knowledge of sh, as itssyntax is what is used in system initialization routines, whether ofthe BSD or SYSV styles.
Virtually any of the newer shells add, to it, such functionalityas:
Command/filename completion (e.g.- spell part of the command name, hit a"hot key," and the shell willtry to complete the name of the command/file;
History manipulation; some ability to re-run previous commands;
Command line editor (so you can edit and re-invokepreviously run commands);
Definition schemes for aliases/functions to allow you to createcustom behaviours.
The FSF folks created an exceedingly souped-up version of the Bourneshell with automated command completion and plenty ofadditional functionality. Linuxsystems typically choose Bash as the"basic" shell usedby default and for managing init.
Linux Shell Scripting with Bash
This is a pretty comprehensive book that guides the reader onhow to use Bash for a wide variety of purposes.
It is very well-motivated; each chapter introduces the area itexamines with an interesting anecdote, and presents a reasonably richset of examples of how to use Bash along with other Unix tools tosolve the problem at hand.
It is not solely about Bash; it shows the use of process controltools like ps, kill, and such, text manipulation tools like grep, sort, cut, sed, and such, and versioncontrol using CVS. This is all well andproper: One of the major uses of shell scripting is to paste togetherother programs, and these examples support that.
It isnot focused on how to do unusual andabstruse things with Bash; if you're looking for"edgecases," you are probably better off looking through the INFOpages or even the source code. If your needs aren't that abstruse,then even relatively advanced script programmers should be able tolearn a few things from the book...
AdvancedBash-Scripting HOWTO - A guide to shell scripting, using Bash
Extended version of the C Shell that adds such functionality ascommand completion, a command line editor, enhanced historymanipulation. The"t" is for Tenex; this shell was initiallydeployed on the Tenex operating system.
CSHProgramming Considered Harmful
CSH is a fairly nice interactive shell that has syntax thatlooks a lot more like C than that of the Bourne Shell. Traditionally,it wasconsiderably superior for interactive usethan sh, and back in my university days, preferred the"Tenex-extended" version calledtcsh. Unfortunately, it has somevery seriousblemishes that make its use for writing substantial shellscripts inadvisable.
Ksh is now nearly universally available, is much cleaner for programming shell scripts, and is thusgenerally preferable.
This shell, written by David Korn, of Bell Labs, is now thedefacto-standard shell for Unix systems, available on virtually anyUnix-like system sold in the 1990's and beyond.
It's a reasonable platform for both interactive system controlas well as shell script programming, providingfar superior functionality to the Bourne Shell.In many cases, it is quite a bit faster, too.
zsh is a really powerfulshell that provides fairly much the functionality of ksh, csh, andbash thrown together.
One area in which it is dramaticallypowerful is in its ability to interactively evaluate and modifyarguments. It can do command name completion, filename completion,and is extensible such that it can use programs to evaluate possiblecommand completions.
For instance, I use the MH mail system. zshcan do folder name completion for MH commands, so that I mighttype:
% refile +Linux/Ad
and pressTABzshwould executeMH code to look up the list of folders underLinux, and, since the only one matching what had been typedwas Linux/Advocacy,zsh wouldcomplete the parameter thus:
% refile +Linux/Advocacy/
As a result, I seldom need to fully spell outanything; I need only spellenough, and then pressTAB and letzsh spell it outfor me.
Similar to the Bourne shell, but with a much more powerful setof programming features, and with an actual formal languagedefinition,rcwas created for the Plan 9 operatingsystem.
Such as Perl, Tcl, Python, Ruby, REXX...
These languages often allow linking in system libraries andoffer more sophisticated data structures (e.g. - structuredrecords, arrays,"objects", and such) which make them reasonablelanguage candidates for implementing entire applications.
"Scripting" languages were traditionally used to controlthe execution of the"real" programs written in"realprogramming languages;" it is no longer obvious that the distinctionbetween"scripting" and"real" languages continues to beof terribly much importance.
Turns Unix Shell scripts into a compiled form (probably using C) suchthat the internal contents are not revealed. Running strings won'ttell you what it does...
A command shell implemented entirely inElisp that runs in anEmacs buffer.
Two primary reasons to get excited about this are if:
You run Emacs everywhere, making EShell more portablethan its alternatives;
You have a great deal of ELisp functions that you would like to be able to use inscripts.
A trivial Unix shell. No globbing; no internal commands; itjust takes in lines that consist of single commands with argumentsseparated by blanks or tabs. Source code consists of one file withabout 6K of C code.
A modular Perl shell written,configured, and operated entirely in Perl. It aspires to be a fullyoperational login shell with all the features one normallyexpects. But it also gives direct access to Perl objects and datastructures from the command line, and allows you to run Perl codewithin the scope of your command line. And it's named after one ofthe greatest characters on Futurama, so it must begood!