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

Re: "typeset -x" vs. "export" in 3.1.6



On Oct 24,  1:25pm, Alexandre Duret-Lutz wrote:
} Subject: Re: "typeset -x" vs. "export" in 3.1.6
}
} >>> "BS" == Bart Schaefer <schaefer@xxxxxxxxxxxxxxxxxxxxxxx> writes:
} 
} [...]
} 
}  BS> There doesn't seem to have ever been doc written for "typeset -g".  
} 
} I have just read a paragraph about it in zshbuiltins.1 !

Ah, there it is.  I didn't see it before because it isn't among "The
following attribute flags ...".

}  BS> Can someone who has a real ksh available please confirm
}  BS> what the precise ksh behavior is?  Does it differ in 88/93?)
} 
} ~ % ksh
} venus:281> foo() { typeset -x bar=123; sh -c 'echo $bar'; }
} venus:282> foo                                  # note: ^--- is needed
} 123
} venus:283>
} 
} So having 'typeset -x' doing 'typeset -xg' seems to be right for 
} ksh emulation. 

Could you do one more test, please?

	foo() { typeset -x bar=123; sh -c 'echo $bar'; }
	bar() { typeset bar; foo }

Now run "bar".

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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