From 9b4e51f72d640262161e38981a8b9255a7b47f6c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 21 Feb 2017 19:20:28 +0200 Subject: Add note on variable expansion and set builtin in testscript --- doc/testscript.cli | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'doc/testscript.cli') 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. -- cgit v1.1