Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14569 > unrolled thread

Re: History of bash's support for self-modifying shell scripts?

Started byÁngel <angel@16bits.net>
First post2018-09-11 01:11 +0200
Last post2018-09-11 01:11 +0200
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: History of bash's support for self-modifying shell scripts? Ángel <angel@16bits.net> - 2018-09-11 01:11 +0200

#14569 — Re: History of bash's support for self-modifying shell scripts?

FromÁngel <angel@16bits.net>
Date2018-09-11 01:11 +0200
SubjectRe: History of bash's support for self-modifying shell scripts?
Message-ID<mailman.618.1536621116.1284.bug-bash@gnu.org>
On 2018-09-09 at 22:25 -0700, Josh Triplett wrote:
> (I don't want to use this mechanism myself; I'm asking because I'm
> working on a project that needs to care about various shells'
> compatibility requirements, and I wanted to find out more about this
> unusual corner case.)

The Thompson shell (up to Sixth Edition UNIX) supported a goto command
that was implemented as an external command(!) that moved the
filepointer to the label location (marked by the : command).

The PWB shell (Mashey shell) initially had if/switch/while, but they
used a goto to move the filepointer.

This tells us that self-modifying scripts would be possible on these
shells, and probably they also worked on th original bourne shell.

With these level of trickery, I wouldn't be surprised if some
self-modifying shell scripts were in use at the time (or were thought to
be) and bash was coded this way in order not to break them
(I can't really come up with a good use case for this feature, though). 

You may find these resources interesting
https://etsh.io/
https://www.in-ulm.de/~mascheck/


Regards

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web