Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
var=$( typeset "$1" ) ... not within a function.
- X-seq: zsh-users 28232
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: var=$( typeset "$1" ) ... not within a function.
- Date: Thu, 20 Oct 2022 10:21:29 -0700
- Archived-at: <https://zsh.org/users/28232>
- List-id: <zsh-users.zsh.org>
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author