From f021f61f10c566fcae2f77b1a4b095869076062b Mon Sep 17 00:00:00 2001
From: Laurent Bercot
Date: Wed, 30 Dec 2020 23:06:31 +0000
Subject: Add -E option for variable autoimport
---
doc/backtick.html | 14 ++---
doc/forbacktickx.html | 7 ++-
doc/forstdin.html | 7 ++-
doc/forx.html | 7 ++-
doc/getcwd.html | 12 +++-
doc/getpid.html | 12 +++-
doc/withstdinas.html | 7 ++-
package/deps.mak | 24 ++++----
src/execline/backtick.c | 82 ++++++++++---------------
src/execline/deps-exe/getcwd | 1 +
src/execline/deps-exe/getpid | 1 +
src/execline/deps-exe/withstdinas | 1 +
src/execline/forbacktickx.c | 11 ++--
src/execline/forstdin.c | 114 ++++++++++++++++-------------------
src/execline/forx.c | 39 ++++--------
src/execline/getcwd.c | 36 ++++++++---
src/execline/getpid.c | 38 ++++++++----
src/execline/withstdinas.c | 59 ++++++++----------
src/include/execline/execline.h | 7 +++
src/libexecline/deps-lib/execline | 2 +
src/libexecline/el_modif_and_exec.c | 36 +++++++++++
src/libexecline/el_modif_and_spawn.c | 39 ++++++++++++
src/libexecline/el_spawn0.c | 1 +
23 files changed, 333 insertions(+), 224 deletions(-)
create mode 100644 src/libexecline/el_modif_and_exec.c
create mode 100644 src/libexecline/el_modif_and_spawn.c
diff --git a/doc/backtick.html b/doc/backtick.html
index 1f77432..91e963a 100644
--- a/doc/backtick.html
+++ b/doc/backtick.html
@@ -30,7 +30,7 @@ environment variable, then executes another program.
- backtick [ -i | -I | -D default ] [ -N | -n ] variable { prog1... } prog2...
+ backtick [ -i | -I | -D default ] [ -N | -n ] [ -E | -e ] variable { prog1... } prog2...
@@ -48,6 +48,11 @@ output as a value.
- -N : store prog1...'s output as is, including the last newline, if any.
- -n : chomp an ending newline off prog1...'s output. This is the default.
+ - -e : no autoimport. This is the default.
+ - -E : autoimport. Instead of exec'ing into
+prog2..., exec into importas -ui variable variable
+prog2.... This substitutes variable into the command
+line instead of putting it into the environment.
@@ -69,12 +74,5 @@ or to whatever prog1... wrote before crashing;
then execution proceeds.
- Notes
-
-
- - You can start prog2... with "importas -u variable variable"
-to perform variable substitution.
-
-