This patch fixes some bugs of the 45.7 shell that was published with BB2.
You *must* provide the Os 3.9 BB2 to apply this patch. Please read the
FAQ below *carefully* before resuming.
This release *also* includes a new version of the Execute command not based
on the CBM or Os 3.9 (H&P) version that fixes quoting in scripts. Quoting
was broken and prevented to use arguments with blank spaces safely within
shell scripts. The new version of execute parses scripts following the
same syntax of the shell, and escapes arguments within quotes properly.
Additionally, input and output of Execute can be redirected now.
IMPORTANT: Execute MUST be made resident to make the new logic working.
Fixed handling of backticks within comments. They are now
Fixed handling of equal-signs within arguments. They are
now considered similar to blank spaces and consider
following double-quotes as function, not as literal.
Fixed result code of PopCD. Fixed search path for external
scripts with a non-native shell interpreter. Fixed the same
problem for datatypes. The Shell will now use PROGDIR:
Fixed handling of alias expansion and backticks. In case
a backtick expansion resulted in a string containing
backticks, an alias would expand the second backtick pair
again even though it shouldn't.
Changed handling of variable expansion once again. The shell
used to expand variables after argument parsing; especially,
if the command was given by a variable, blanks were considered
parts of the command. This might possibly be desirable, but
I changed it for backwards compatibility.
Fixed two bugs of alias handling: Alias expansion now also
recursively expands backticks and shell variables in the alias
This version also provides a new feature of the shell, namely
interactive debugging of shell scripts. To enable it, set the
variable "interactive" to "on". The shell will then prompt
every command it executes and waits for your response. The command
can be run by pressing return, skipped by pressing DEL or the shell
script can be aborted with ESC. This can be a useful tool for
debugging the startup-sequence.
The alias arguments are now also valid within variable names and
backticks. Furthermore, alias, variable and backtick expansion got
rewritten, removing any circular dependencies, i.e. alias, backtick
and  expansion are now done in one single step. This has the side
effect that backticks can not be used to expand to variable names
(similar to the bash) and the keepdoublequotes variable also applies
to the alias  argument. It has another (positive) side-effect
that no part of the command string is really parsed twice, thus
avoiding trouble of backticks or variables that expand to another
defined variable name by pure chance.
Another seemingly minor improvement is that recursive execution of
script files finally works (for the first time ever), meaning that
you can actually skip back in front of another EXECUTE command. To
make this working, make sure that C:Execute is resident before the
shell requiring this feature is started. This seemingly simple
feature required major trickery in the shell and corrects at least
one of the anoyances of the Amiga Shell.
The magic "hash-bang" sequence was partially broken and did not
append additional command line arguments to the executing program
correctly. This got fixed.
Previous versions did not update the CLI stacksize field when
creating run-back processes with the "&" operator, even though
the correct size of stack was allocated. Nevertheless, some
programs rather checked cli_DefaultStack instead of the stack
size they got, and reported a lack of stack. This version fixes
The 45.29 version did not correctly carry over the return code
of a command executed in back-ticks to the main shell. This version
now reports the original secondary return code of the sub-shell as
error again, e.g. whenever you execute a command in back-ticks, and
this command fails, the shell will print this failure as error code.
As execute is all new now, the special hack that allowed
recursive execution of scripts is no longer necessary and has
been removed from the shell.
Fixed a resource leak in recursive shell execution.
Fixed another potential resource leak in out of memory
Allows now also input/output redirection of the execute
command by storing the shell streams on the execution stack
For some strange reason, even the original shell did not
clean up a command file left behind from an execute called
indirectly through a System() call. This is probably an
oversight and not a design decision, so the shell cleans
up in this case as well.
In case a recursive shell script was launched through
System() instead through the shell directly, the shell
erraneously terminated the entire recursive call at the
EOF of the deepest nested script. As a related bug, the
"QUIT" command did not work properly for recursive
scripts and terminated only the current script, but not
the entire hierarchy as it should.
Nothing changed in the shell, except for a broken version
string in the previous release. Execute was updated to a
new release - 45.15 - which addresses one parsing conflict.
If .bra was set to the curly bracket, Execute always
performed formal parameter substitution, even if a dollar
sign in front of the curly bracket indicated a shell
variable. This release of Execute is a bit more careful
and only expands formal parameters if the token cannot
be confused with that of a shell variable.
Note, however, that setting the .bra and .ket characters
to curly brackets is discouraged due to the syntax conflict
with shell variables. Unfortunately, the same goes for
angle brackets that can be confused with I/O redirection.
Square brackets might be still available in many
situations, except if you define aliases. *Sigh*
Nothing has changed in the shell. The only fix in this
release is "Execute" which had still a bug (*sigh*) in
handling quotes correctly. Due to an oversight and a
single misplaced line, all characters were parsed twice,
making quotes essentially non-functional.
This release provides a working release of "Execute"
This is again a small update to Execute. Execute failed
to accept a script which explicitly defined to take no
arguments, i.e. with a ".KEY" directive with an empty
Some frequently asked questions:
Q: How official is this distribution?
A: As official as I could make it. There will be no future BB for Os 3.9,
but I still wanted to provide an update. Hence, here we go. Both, Amiga
and H&P agreed to my conditions, therefore this patch is fully legal.
Q: What about customer service and support?
A: There is absolutely no support and no warranty. You are welcome to
ask questions, but please direct them to me (see my email above) directly.
Neither H&P nor Amiga will provide any service or support or warranty
concerning this product.
THE PROGRAM IS PROVIDED TO YOU "AS IS," WITHOUT WARRANTY. THERE IS NO
WARRANTY FOR THE PROGRAM, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE
RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD
THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
SERVICING, REPAIR OR CORRECTION.
If you do not agree with these limitations, you must not install this update,
and must remove the patch and the archive containing the patch from your
storage device immediately.
Please double-click on the "Install" icon. This program will extract
the shell from the AmigaOs ROM-Updates file, will patch it and place
the resulting shell to the L: drawer. Further, it will copy the
LoadModule program to C:.
You also will have to make some modifications on your startup-sequence.
The installer script will open an editor to allow you to modify
the startup-sequence, and will print the required instructions.
Unfortunately, these instructions have to be carried out by hand and
cannot be automatized easily. Please follow the instructions
closely. For convenience, I repeat them here:
1) Locate the "SetPatch" command within the startup-sequence, place the
cursor on the "S" of "SetPatch" and press <RETURN>. This will insert a new
blank line ON TOP of SetPatch. Move the cursor upwards into this blank
line and enter the following command:
LoadModule L:Shell-Seg NOREBOOT
In case you are using LoadModule already, please add L:Shell-Seg as one of
its arguments, unless you run LoadModule with the "AUTO" already, which
will automatically include the shell update. No further modifications are
*NOTE THAT IT IS IMPORTANT THAT LOADMODULE IS RUN BEFORE SETPATCH*.
If you do not use the AUTO argument of LoadModule, ensure that the argument
line of LoadModule includes "L:Shell-Seg" as such:
LoadModule L:Shell-Seg L:Ram-Handler LIBS:icon.library LIBS:workbench.library
(This is one line, no line feed intended)
The advantage of "LoadModule" is that the ROM modules loaded by this command can
be protected from getting overwritten by means of the "MuProtectModules" program
of the same author (not included in this archive).
2) Locate the "SetPatch" command within the startup-sequence. Move the cursor
behind "SetPatch", and add the command line option "SKIPROMMODULES shell"
to the command. The setpatch command line should then read approximately as
SetPatch SKIPROMMODULES shell >NIL:
If you already have to skip parts of the update, as for example the
scsi.device, the line should rather look like this:
SetPatch SKIPROMMODULES scsi.device,shell >NIL:
3) Somewhere in the startup-sequence, the "Execute" command should be made
resident. It does not matter very much where this happens, any place between
SetPatch and "LoadWB" works. For example, locate "LoadWB" in the
Startup-Sequence, and insert the following command *above* it:
resident C:Execute pure
4) Save the changes of the startup-sequence back. For "Ed", press first <ESC>,
then <X>, then <RETURN>.
5) Copy the "Execute" command from this distribution over the 3.9 version of
Execute. It is a drop-in replacement, so execute the following command in the
copy Execute to C:Execute
6) Ensure that the Execute command has its "pure" and "hold" bits set. For
that, run the following command in the shell:
protect C:Execute ph add
7) To make the changes active, a reboot is *NOT* enough. You should turn
off the machine, wait for half a minute, and reboot. This will flush the
RAM resident parts of the ROM-Updates mechanism.
For more information concerning "LoadModule", check "LoadModule.lha" on