zsh-users
 help / color / mirror / code / Atom feed
* Interpret Parameter Value at Time of Function Definition
@ 2017-09-05 13:47 Vin Shelton
  2017-09-05 16:17 ` Daniel Shahaf
  2017-09-05 18:21 ` Martijn Dekker
  0 siblings, 2 replies; 6+ messages in thread
From: Vin Shelton @ 2017-09-05 13:47 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 374 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-09-06  4:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-05 13:47 Interpret Parameter Value at Time of Function Definition Vin Shelton
2017-09-05 16:17 ` Daniel Shahaf
2017-09-05 20:51   ` Bart Schaefer
2017-09-05 18:21 ` Martijn Dekker
2017-09-06  3:08   ` Ray Andrews
2017-09-06  4:16     ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).