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

2018-09-10 Thread Josh Triplett
While digging into the details of how bash reads shell scripts, I found some indications that bash goes out of its way to support self-modifying shell scripts. As far as I can tell, after reading and executing each command, bash will seek backward and re-read the script from the byte after the end

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

2018-09-10 Thread Chet Ramey
On 9/10/18 1:25 AM, Josh Triplett wrote: > While digging into the details of how bash reads shell scripts, I found > some indications that bash goes out of its way to support self-modifying > shell scripts. As far as I can tell, after reading and executing each > command, bash will seek backward an

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

2018-09-10 Thread Josh Triplett
On Mon, Sep 10, 2018 at 04:50:29PM -0400, Chet Ramey wrote: > On 9/10/18 1:25 AM, Josh Triplett wrote: > > While digging into the details of how bash reads shell scripts, I found > > some indications that bash goes out of its way to support self-modifying > > shell scripts. As far as I can tell, af

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

2018-09-10 Thread Ángel
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

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

2018-09-10 Thread Robert Elz
Date:Tue, 11 Sep 2018 01:11:41 +0200 From:=?ISO-8859-1?Q?=C1ngel?= Message-ID: <1536621101.1095.13.ca...@16bits.net> | The Thompson shell (up to Sixth Edition UNIX) supported a goto command | that was implemented as an external command(!) that moved the | filepo