On Thu, Nov 19, 1998 at 07:54:21PM -0800, Suzanne Stephens wrote:
> OK, stupid question No. 2:
>
> What is a shell?
Generically: A program that provides a way to run commands.
Usually this means a command line shell, like the Unix Bourne shell
(sh), C-shell (csh), Korn shell (ksh) and a zillion other ones.
I suppose it's called a "shell" because it is analogous to a
"shell" around the operating system.
Maybe it will help to explain what it doesn't do, and what it does do
in the context of a typical Unix or Linux system.
Unix essentially consists of three parts:
1. The OS kernel, which manages the physical resources of
the machine. This handles the filesystems, networking,
I/O, and all that.
2. The utilities, like "sort" and "Perl" and "awk" and "grep"
and "yacc" and several hundred other ones.
3. The shell, which is one way for users to interact with 1 & 2.
One of the spiffy things about Unix is that all three parts are
interchangeable. If you don't like the Bourne shell, use csh, or
something else -- even a menu-based shell or a GUI-based shell.
The underlying OS doesn't know or have to know. Another spiffy
thing is that most Unix shells are actually reasonably powerful
programming languages: you can write shell "scripts" which resemble
C or Perl programs, are interpreted on-the-fly when run, and which
do interesting things.
(Also, if you don't like the version of "awk" that comes with your
system, you can replace it. Or delete it. The GNU utilities provide
an increasingly complete set of replacements for all of the ones
shipped with most Unix distributions.)
So typically the sort of thing you'd be done in a shell are things like:
mutt -f =inbound
Invoke the "mutt" mail client on folder "inbound"
tail /var/log/syslog
Show the last few lines of the system log file
gzip sendmail.tar
Compress a tar archive of the sendmail source code
vi /tmp/d
Edit the file /tmp/d with the vi editor
cat /tmp/1 /tmp/2 > /tmp/3
Concatenate files /tmp/1 and /tmp/2 into file /tmp/3
Or you could write a shell program like this:
foreach i (*.pcx)
set j = `basename $i .pcx`
pcxtoppm < $i | ppmtogif > ${j}.gif
end
which is a chunk of a csh program that turns all the files in a directory,
in whatever format they are, into GIFs.
So is this making sense or did I lose you at the third left turn? ;-)
---Rsk
Rich Kulawiec
[EMAIL PROTECTED]
____________________________________________________________________
--------------------------------------------------------------------
Join The Web Consultants Association : Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------