			ABOUT scripting

In unix, a command that interprets instructions until told to quit can get
it's instructions from the user, or from a file. The standard shell, Bash
in cLIeNUX, is the primary example. Bash is also the prime example of how
the shell makes other interactive commands more powerful, since Bash can
call itself to run a script, just as it can do with many other interactive
commands. The shell is like a great basketball point-guard, it enhances
the whole team.

awk has some of the features you start to wish Bash had after using it for
a while, like real math, a cleaner syntax, the ability to deal with the
contents of a file sensibly. Bash doesn't really want to be looking *into*
files. 

dcon is very simple, easy to learn, and talks back and forth to a modem or
similar device. dcon is also a remarkable example of minimal but versatile
access to host facilities. It can fork, open and close files, and so on.
dcon instructions, unlike Bash, bear some resemblance to the basic
operations of a CPU. Bash is very abstract, or "high-level", since it
deals primarily with files, which are a very abstract thing.  see
programming. 

The EPIC Internet Relay Chat client included with cLIeNUX is virually an
entire network operating system. It has a rich Perl-like scripting
language that is well and sensibly employed by the splitfire script. 

Forth is a high-performance programming language, in terms of program
resource efficiency and also programmer efficiency. It is very different
from C, and has influenced cLIeNUX quite a lot. With some effort to learn
Forth's distinctly non-unix-family nature, one has an interactive
programming environment with performance approaching native code from pure
compiler languages like C. Forth is a bit strange at first, but it's
strangenesses are deeply considered, to Keep it Simple. cLIeNUX Core
includes Gforth, an ANSI Standard Forth, and will always include a Forth,
such that a Forth can be assumed by cLIeNUX script writers. Gforth accepts
standard input just fine, as well as several other program invocation
methods. 
 Conceptually Forth is not a scripting language, and is in fact often
implemented as strikingly efficient silicon CPUs, but as implemented on a
unix host it does resemble a scripting language more than a compiler.


The reason I used somewhat ambiguous language above to describe scripting
languages is that in unix, by virtue of shell redirection, anything that
gets user controls from standard input can be scripted. This includes
things like ed, mail, ftp, news, browse, spreadsheet, calc, minicom, lots
of stuff.  The "scripting language" of a particular program is it's usual
interactive language, whatever you normally type at it. This unfortunately
doesn't pertain to the mouse, and is a bit ridiculous with meta-character
commands as in edit (Pico), but still represents massively under-utilized
flexibility. A utility like ftp may not be a programming language in the
strict sense that it can do general data processing, but it can help to
completely automate things it's good at. The more durable unix interactive
commands like ed, mail, telnet, ftp and so on were designed with this in
mind. 

The syntax of using a script with a command like ed might be as simple as

ed < your_ed_script

or 

ed file < your_other_ed_script

or

ftp host < my_update_script



Copyright 1999 Richard Allen Hohensee
This file is released for redistribution as part of cLIeNUX only.


