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

Re: "var=value exec > file" ignores the assignment?



On Wed, 15 Apr 2015 20:52:18 +0100
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> This (based on the previous patch) might be good enough.  It could
> probably do with a couple of tests.

Let me know if you've heard this one...  That's not what I meant.  You
know what I meant.

pws

diff --git a/Test/A04redirect.ztst b/Test/A04redirect.ztst
index 13f1f7c..602341d 100644
--- a/Test/A04redirect.ztst
+++ b/Test/A04redirect.ztst
@@ -538,3 +538,20 @@
   print $functions[noredirfn]
 0:Output from $functions[] for definition with no redirection
 >	print This rather boring function has no redirection.
+
+  (x=43
+   x=$(print This should appear, really >&2; print Not used) exec >test.log
+   print x=$x)
+   cat test.log
+0:Assignment with exec used for redirection: no POSIX_BUILTINS
+>x=43
+?This should appear, really
+
+  (setopt POSIX_BUILTINS
+   x=45
+   x=$(print This should appear, too >&2; print And this) exec >test.log
+   print x=$x)
+   cat test.log
+0:Assignment with exec used for redirection: POSIX_BUILTINS
+>x=And this
+?This should appear, too



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