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

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



On Thu, Oct 20, 2022 at 7:22 PM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> function ii ()
> {
>      var=$( printenv "$1" )
>      [ "$var" ] && var=$( typeset "$1" )
>      print "var is: $var    "
> }
> $ . test; ii USER
> var is:
>
> ... why won't 'typeset' work there?

Try typing `typeset USER` in your interactive shell. What do you get as output?

Take a look at typeset_silent option.

Roman.




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