Re: execline: use of define, export, unexport, import

From: John Vogel <jvogel4_at_stny.rr.com>
Date: Tue, 26 Aug 2014 16:16:08 -0400

On Mon, 25 Aug 2014 22:47:21 -0500
Patrick Mahoney <pat_at_polycrystal.org> wrote:

>
> What happens is that the arguments to the first "define" command are
> "var 0 foreground ..." all the
> way to the # end of script marker. The first define treats its entire
> argument as a string, and
> performs the substitution on every occurrence of $var, of which there
> are three. It then passes
> this modified set of args to the foreground command, which in turn
> passes all args after its
> block to export, and so on. The second define attempts to perform
> substitution on its argument (the
> entire set of following args), but since they've already been
> substituted, there is no longer any
> instance of $var, and no substitution is performed.
>
> The trick is these are not variables as in most languages, but
> substitutions performed
> on a giant string of all the args from here to the end.
>

This explanation helps me a great deal. Thank you very much.

--
  John
Received on Tue Aug 26 2014 - 20:16:08 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC