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

Re: inconsistent behavior observed with export VAR=VAL versus VAR=VAL zsh 4.2.6



This makes the documentation for typeset clearer.

Index: Doc/Zsh/builtins.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/builtins.yo,v
retrieving revision 1.97
diff -u -r1.97 builtins.yo
--- Doc/Zsh/builtins.yo	6 Jul 2007 21:52:39 -0000	1.97
+++ Doc/Zsh/builtins.yo	18 Aug 2007 10:03:38 -0000
@@ -1331,7 +1331,14 @@
 
 For each var(name)tt(=)var(value) assignment, the parameter
 var(name) is set to var(value).  Note that arrays currently cannot be
-assigned in tt(typeset) expressions, only scalars and integers.
+assigned in tt(typeset) expressions, only scalars and integers.  Unless
+the option tt(KSH_TYPESET) is set, normal expansion rules apply to
+assignment arguments, so var(value) may be split into separate words; if
+the option is set, assignments which can be recognised when expansion is
+performed are treated as single words.  For example the command
+tt(typeset vbl=$(echo one two)) is treated as having one argument if
+tt(KSH_TYPESET) is set, but otherwise is treated as having the two arguments
+tt(vbl=one) and tt(two).
 
 If the shell option tt(TYPESET_SILENT) is not set, for each remaining
 var(name) that refers to a parameter that is set, the name and value of the

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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