zsh-users
 help / color / mirror / code / Atom feed
* var=$( typeset "$1" ) ... not within a function.
@ 2022-10-20 17:21 Ray Andrews
  2022-10-20 17:25 ` Roman Perepelitsa
                   ` (2 more replies)
  0 siblings, 3 replies; 39+ messages in thread
From: Ray Andrews @ 2022-10-20 17:21 UTC (permalink / raw)
  To: Zsh Users

function ii ()
{
     var=$( printenv "$1" )
     [ "$var" ] && var=$( typeset "$1" )
     print "var is: $var    "
}
$ . test; ii USER
var is:

... why won't 'typeset' work there?  Funny thing is that if I run it as 
a script:

  $ var=$( printenv "$1" )
[ "$var" ] && var=$( typeset "$1" )
print "var is: $var     "

...

var is: USER=root

... no problem.  I don't even have a wild guess why this might be.





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

end of thread, other threads:[~2022-11-02 18:23 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-20 17:21 var=$( typeset "$1" ) ... not within a function Ray Andrews
2022-10-20 17:25 ` Roman Perepelitsa
2022-10-20 17:51   ` Ray Andrews
2022-10-20 17:54     ` Roman Perepelitsa
2022-10-20 18:38       ` Ray Andrews
2022-10-20 18:44         ` Roman Perepelitsa
2022-10-20 19:15           ` Ray Andrews
2022-10-20 19:35             ` Roman Perepelitsa
2022-10-20 20:48               ` Ray Andrews
2022-10-21  0:54                 ` Bart Schaefer
2022-10-21  1:58                   ` Ray Andrews
2022-10-21  2:25                     ` Bart Schaefer
2022-10-21 14:24                       ` Ray Andrews
2022-10-21 14:37                         ` Ray Andrews
2022-10-21 17:34                         ` Roman Perepelitsa
2022-11-01  5:00                       ` "typeset -p" inconsistency Bart Schaefer
2022-11-01 12:07                         ` Peter Stephenson
2022-11-01 12:40                         ` Ray Andrews
2022-11-01 19:08                           ` Bart Schaefer
2022-11-01 21:25                             ` Ray Andrews
2022-11-01 21:40                               ` Bart Schaefer
2022-11-01 22:46                                 ` Ray Andrews
2022-11-02  1:13                                   ` Lawrence Velázquez
2022-11-02  2:42                                     ` Ray Andrews
2022-11-02  3:11                                       ` Lawrence Velázquez
2022-11-02 12:56                                         ` Ray Andrews
2022-11-02 17:04                                           ` Bart Schaefer
2022-11-02 17:19                                             ` Ray Andrews
2022-11-02 18:21                                               ` Bart Schaefer
2022-11-02  3:10                                   ` Bart Schaefer
2022-11-02 17:09                                     ` Ray Andrews
2022-10-20 17:29 ` var=$( typeset "$1" ) ... not within a function Mikael Magnusson
2022-10-20 17:43   ` Ray Andrews
2022-10-21 17:33 ` Ray Andrews
2022-10-21 18:25   ` Bart Schaefer
2022-10-21 18:57     ` Ray Andrews
2022-10-21 19:02       ` Roman Perepelitsa
2022-10-21 19:06         ` Ray Andrews
2022-10-21 19:04     ` Ray Andrews

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).