> -----Original Message-----
> From: Stephane Chazelas <stephane.chaze...@gmail.com>
> Sent: Thursday, May 30, 2019 10:14 PM
> To: Steven Penny <svnp...@gmail.com>
> Cc: austin-group-l@opengroup.org
> Subject: Re: Arrays

> 
> In there, instead, a list was stored in a *scalar* variable and split (and 
> globbed) upon expansion when unquoted as in:
> 
>   files='file1 file2'
>   rm -f -- $files # with IFS assumed to contain its default value
> 
> Instead of
> 
>   files=(file1 'file 2')
>   rm -f -- $files
> 
> (or equivalent) in csh, rc, es, fish...
> 
> That was a very bad design probably explained by a desire of Steve Bourne to 
> maintain some level of backward portability with the
> Thompson shell parameter expansion (where it was more like macro expansion). 
> That misfeature is by far the primary source of bugs and
> shell script security vulnerabilities nowadays (see
> https://unix.stackexchange.com/questions/171346/security-implications-of-forgetting-to-quote-a-variable-in-bash-posix-shells)

I think the macro expansion idea came from Louis Pouzin/Multics, as described 
in https://multicians.org/shell.html:

        Then in 64 came the Multics design time, in which I was not much 
involved, because I had made it clear I wanted
        to return to France in mid 65. However, this idea of using commands 
somehow like a programming language was
        still in the back of my mind. Christopher Strachey, a British 
scientist, had visited MIT about that time, and his
        macro-generator design appeared to me a very solid base for a command 
language, in particular the techniques
        for quoting and passing arguments. Without being invited on the 
subject, I wrote a paper explaining how the Multics
        command language could be designed with this objective. And I coined 
the word "shell" to name it. It must have been
        at the end of 64 or beginning of 65.

The macro generator in question is GPM, General Purpose Macrogenerator.

Regards
Konrad

Reply via email to