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

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



On 10/20/22, Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
> function ii ()
> {
>      var=$( printenv "$1" )
>      [ "$var" ] && var=$( typeset "$1" )
>      print "var is: $var    "
> }

What kind of logic is behind this code? You first check if the given
name is in the environment, then you assign over the same parameter
again with the same value using another way to get the value.

-- 
Mikael Magnusson




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