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

var=$( typeset "$1" ) ... not within a function.



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