The find function in this file is our earlier find
function enhanced to show the full file pathname as well. The findall
function is our earlier findall function generalized from
only looking at ".txt" files to accepting the file-extension
string as a parameter. Now let's run this as a standalone program.

Running an E Program from the MS-DOS Shell

At the beginning of this chapter we saw how to start rune
from an MS-DOS prompt:

findall.e knows it needs three arguments, and notices that
these haven't been provided. We use the built-in function throw
to indicate that an exception has occurred, and to prevent the program
from continuing past this point as if everything were fine. The value
we provide to throw should be a description of the problem
-- in this case, an explanation of how findall.e should be
invoked. (This usage string does not include the leading "e"
as this is only necessary under some operating systems.) All the junk
after the usage message is a stack traceback. Later we will learn how
to use or suppress these, but let's ignore it for now.

Running an E Program from the Bash Shell

Unless you are required to work with the MS-DOS shell for some ungodly
compatibility reason, we recommend bash, already pre-installed
on all Unixes, and available
for Windows from Cygnus Support.

Everything you can do with E using the MS-DOS shell you can also do
in the bash shell. In addition, if there is an rune command on your
path (which the E installer does by default), and if you copy Cygwin's
env command to /usr/bin,

An E program can be invoked from within shell scripts(such as bash scripts)
in this manner. In addition, a shell script can contain an E program which
it invokes directly. Here's how you can demonstrate the principles involved
interactively:

The "-" tells rune to interpret its standard
input as if it were an E program in a file (rather than interactively).
The "<< FOO" and matching "FOO"
is bash-speak for "Take all the text between the FOOs and feed it
to the command on the left as its standard input.". Like E, bash
prompts you with "> " when you are in the midst of entering
a single multi-line command. The "> " prompts above came
from bash rather than E.

Making findall.e Launchable as a GUI Application

*** to be written

Unless stated otherwise, all text on this page which is either unattributed
or by Mark S. Miller is hereby placed in the public domain.