[comp.sys.amiga] Resident .. wildcards ?? and printenv

rademach@tramp.Colorado.EDU (Simon Rademacher) (08/05/89)

In article <8908030823.AA24551@jade.berkeley.edu> LAUL@UREGINA1.BITNET (Dennis Gorrie) writes:
>
>I would instead like to make the whole C dir RESIDENT  , with one command
>(I don't want to have to RES every single program in the C dir one at a time.)

Let me start by saying that I've been trying to get something like unix's
printenv to show what value each env: variable has.  Well, when I finally
read the docs for arp 1.3, I found the answer.  Extrapolating from the docs
for list, I came up with the following alias:

alias printenv Ls env: LFORMAT="echo >null: %S\Necho \"%S=\" noline\Ngetenv
%S" \| execute

(ls is my name for list)  The pipe must be escaped (\ for me) or the | execute
is done rather than included in the alias.

A brief description might be in order.  Skip this paragraph if you're an arp
wizard.  The ls is the heart.  It lists all files in env: using the format
given in LFORMAT.  The variables %S in the format represent path or
filename.  1 gives name, 2 gives path/name, 3 gives path/name/name, 4 gives
path/name/path/name, I think.  Check docs to be sure.  I needed the name
twice, once to print, and once to getenv on.  Hence I needed 3 %S's.  But
since I didn't want the path (env:) to print, I echo'ed it to null:  (Nil:
would probably work too.)  The \N is a newline to separate commands.  The
second echo just prints the name of the variable and an equal sign with no
newline (noline).  The last part then, prints the command getenv and the
file/variable name.  Since all this is piped to execute, each command is
invoked.  Leave off the | execute to see exactly what ls is printing.

So where is all this leading?  If you remember, the goal was to ares all
commands in c:.  By using ls, one could build either a very long ares
command, providing ares can handle >50 files, or a series of ares commands.
If you ares ares first, you don't loose much speed here.  (execute is built
into the arp shell.)  I tested the following and it works for the latter
case.

ls c: LFORMAT="ares %S" | execute

Note: ares will fail if it comes upon a file already ares'ed.  This causes
slight problems if you've ares'ed ares.  You can move it out of c: as one
way to fix.  Happy listing!

=======================================
=          Simon Rademacher           =
= rademach%tramp@boulder.colorado.edu =