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

Interpret Parameter Value at Time of Function Definition



I think zsh interprets the value of a shell variable when a function is
run, but I would like to set the value when the function is read.

E.g:

$ aaa=bbb
$ function t {
    print aaa = \"$aaa\"
  }
$ t
aaa = "bbb"
$ aaa=ccc t
aaa = "ccc"

I would like to interpret $aaa at read time, so that:

    aaa=ccc t

would print:

    aaa = "bbb"

How do I do that?

Thanks,
  Vin


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