shell
Chris F.A. Johnson's Unix Shell Scripting
@import "sh.css";
Home Page
Contents/Site Map
Contact Chris
Unix Shell Scripting by Chris Johnson
The shell referred to in these pages is always a Bourne-type shell;
that is, a shell whose syntax is based on the Unix
shell introduced by Steven Bourne in 1978 (or thereabouts), with
some later improvements. On all Unix systems, a Bourne-type shell
can be found in /bin/sh. On most modern systems, this will be somewhat
better than the Bourne shell — it will be a POSIX shell. If it
is not, there should be a POSIX-compliant shell elsewhere on the
system.
A POSIX shell is a Bourne shell with a number of extensions (which
are mostly derived from the Korn
Shell). The most important ones perform string manipulation and
integer arithmetic. In a Bourne shell, arithmetic operations require
an external program (e.g., expr, awk or
bc) as does finding the length of a string, or cutting
a string into pieces. POSIX has $((...)) for integer
arithmetic and parameter expansions for string operations.
Generally, scripts and snippets published here are designed to run
in a POSIX shell. Some will run in a Bourne shell, and those that
will not should not be hard to convert (in the unlikely event that
you find it necessary). A few scripts require added extensions found
in bash and ksh.
What, no csh?
Before POSIX shells became generally available, many people used the
C shell as their interactive shell. It has a number of features that
were lacking in the Bourne shell, including arithmetic and command
history. However, when it comes to writing scripts, it has many
drawbacks that are discussed in these three articles:
Top Ten Reasons
not to use the C shell
C shell problems
Csh
Programming Considered Harmful
Since, as Bruce Barnett says in the first of the above articles,
"UNIX was hard enough to learn, and spending months to learn two
shells seemed silly", I recommend using a Bourne-type interactive
shell, and I specifically recommend bash.
If you need help with a csh problem, try Bruce Barnett's
csh page.
If you are having trouble getting a shell script to do
exactly what you want, you need... Shell Scripting Assistance
Here are some odds and ends that might help you write or
improve a script... Tuesday's
Tips
Notes on
Unix commandsbasename, dirname, grep, expr, wc...
Bash
loadable builtins add new, high-performance commands to
the shell
Here are a number of
my shell
scripts some are documented, others not (yet)
In the summer of 2004, Apress open source editor, Jason
Gilmore, asked me to put together a cookbook of shell scripts.
The result is
Shell Scripting Recipes: A Problem-Solution Approach
(Apress, 2005)
Articles that I have written
for Sys Admin magazine and
UnixReview.com
For more information on shells and shell scripting, see this
collection of
links to other shell resources
If you find this site useful, please consider supporting it with a donation:
Home Page
Contents/Site Map
Contact Chris
last modified Wednesday, 25 Jul 2007
разделы
телематические служба
затенение витрина
охота пиранья
комнатный перегородка
эдас-134 аденома предст.ж-зы
спецобувь производитель
куллер 478
автоматический отправка писем outlook
нестандартный коробка
любимый цвет
время владимир
сенсорный экран устройство
электропечь dimplex model elba
торговый витрина
видеосъемка торжество
сбор д/полоскания горло зубной боль
время иваново
lida
толщиномер
регестрация пбоюл
антенна акустомагнитные
mobil gargoyle
поставщик вина
время архангельск
доставка суша
позитивный психология
выписка егрп
5004.13 (крышка)
избавиться спам
комнатный перегородка
набор гинекологический
антигололедные реагент
пбоюл
сервер hp
георешетка
контакт контактор
наркомания
mastercard
организация видеоконференция
рассылка адрес
ичп пбоюл
портативный радиостанция
витрина подогреваемый
крот dr
портативный радиостанция
гостинницы санкт-питербурга
капсула миаози
купить ломтерезку
сенсорный экран
туба машина
ожирение
время кострома
измеритель температры
гостинницы санкт-питербурга
пп-пленка
сервис alfa laval
проходить осмотр гинеколог
продать кайт
бак накопитель
shell