On Mon, 25 Aug 2014 22:47:21 -0500 Patrick Mahoney <[email protected]> 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
