Hallo Ralf!
> It seems that it is impossible to replace a forward slash in a
> variable expansion, even if the slash is quoted:
The version of ash in busybox has a long standing bug in the quote
handling code ... and I'm the one whoe probably produced this bug!

Years ago, as far as I remember it was somewhat at the beginning of the
90s, I dig deep into the code of ash and bash to create a modified shell
version for a special purpose. The final version of this hell was based
on the original version of ash, with several modifications and major
hacks from me. After creating that special shell, I wanted to have a
normal unix shell, which is small and compatible in it's normal behavior
to that special shell. Due to the fact, I lost the original code of ash,
I stripped of the extensions, which made the other shell special. And
used that version under the name ash.

Neither the special shell, nor the stripped down version I used as ash,
were officially distributed and I never mentioned my modifications or my
name in the source code ... but exactly this stripped down version of
ash made it into busybox ... I don“t know how the hell it did!

The major difference between the original ash version and my modified
version were a couple of code size improvements and source code
clearance work I did. Those changes are really welcome to the philosophy
of busybox, I think, and there is nothing wrong with it, that they got
used within busybox ... but beside those welcome changes, I introduced
two major bugs in my ash version ... and both have been included in
busybox too ...

One bug was in code that tried to deal with this pipe/loop/subshell
problem ... it tried to catch that situation and run the loop in the
current shell, but was buggy and it seems to be that code part has been
removed from busybox in an early version (I think ist was anywhere in
the 0.50er or 0.60er line). The code substituted looks more like the
code from the original ash.

And the second bug, which I couldn't track down until now, is that one
in the shell quote handling. I mangeld with this, without really
understanding, how it worked (blame me). My code changes removed a
problem (not bug) that a had in the specialized shell version but
introduced some spurious behavior when quotes get mixed up or nested.
The only thing I can tell is, the code in busybox works, if you reduce
the level of quoting. That is, don't do too much at once. Do it in
several steps, assigning the result of string mangling to variables and
use those variables as simple substitutions in further steps.

This is the story of busybox ash and the reason why there are major
differences between the original ash manpage and the ash version in
busybox. I introduced those differences (and bugs) without noting them
anywhere but I never expected those coming up in any other officially
distributed version :-(

--
Harald

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to