aboutsummaryrefslogtreecommitdiff
path: root/doc/testscript.cli
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-02-21 19:20:28 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-02-21 19:20:28 +0200
commit9b4e51f72d640262161e38981a8b9255a7b47f6c (patch)
tree7203be8748ff780027bd8e42bc2cdae945c7a929 /doc/testscript.cli
parent0600d3a82c414fff5e63038f9550ca28698ce6d6 (diff)
Add note on variable expansion and set builtin in testscript
Diffstat (limited to 'doc/testscript.cli')
-rw-r--r--doc/testscript.cli10
1 files changed, 9 insertions, 1 deletions
diff --git a/doc/testscript.cli b/doc/testscript.cli
index 49e9d45..918dd4a 100644
--- a/doc/testscript.cli
+++ b/doc/testscript.cli
@@ -2438,7 +2438,15 @@ Set variable from the \c{stdin} input.
Note that \c{set} is a \i{pseudo-builtin}. In particular, it must be the last
command in the pipe expression, it either succeeds or terminates abnormally,
-and its \c{stderr} cannot be redirected.
+and its \c{stderr} cannot be redirected. Note also that all the variables on
+the command line are expanded before any \c{set} commands are executed, for
+example:
+
+\
+foo = foo
+echo 'bar' | set foo && echo $foo # foo
+echo $foo # bar
+\
Unless the \c{-e|--exact} option is specified, a single final newline is
ignored in the input.