Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: exec -a and parameter expansion



On Jan 8,  9:52pm, Peter Stephenson wrote:
} Subject: Re: exec -a and parameter expansion
}
} On Fri, 07 Jan 2011 18:17:06 -0800
} Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
} > So either there are some missing test cases for other things that
} > this would cause to break, or we should rearrange execcmd() so that
} > "typeset" is the only special-cased builtin ahead of prefork().
} 
} I could be convinced the latter is correct.  Apart from KSH_TYPESET,
} nothing stands out in my mind as needing special behaviour during the
} expansion phase.  A careful search of the manual might be warranted.

There is at least one complication, which is that "builtin typeset ..."
should work the same as "typeset".  And then there's

    noglob builtin typeset
    builtin noglob typeset
    exec builtin noglob typeset
    nocorrect exec noglob builtin typeset

and so on.

} There was some discussion of the KSH_TYPESET behaviour on the Austin
} group list; [...] it might have been worse and and you were expected
} to handle:
} 
}   t=typeset
}   $t foo=`echo one two`
} 
} such that foo was assigned the value "one two".

What this boils down to is that processing the entire command line
at once in prefork() can't be done.  You have to apply the prefork
substitutions to each word before deciding what to do with the next,
at least until you reach one of "command", "typeset", a non-special
builtin, or an external command.

Or prefork has to become clever enough to manage that part ...



Messages sorted by: Reverse Date, Date, Thread, Author