diff options
author | jilles <jilles@FreeBSD.org> | 2013-02-03 15:54:57 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2013-02-03 15:54:57 +0000 |
commit | 6fa139d56eac8251b9a64c249c8e6fc8131f405c (patch) | |
tree | 798963ecfeaa133433ad99b27533d07fa1521c76 /bin/sh/nodetypes | |
parent | aa08976cf0559eb6c97a1886ea652e0f839759e5 (diff) | |
download | FreeBSD-src-6fa139d56eac8251b9a64c249c8e6fc8131f405c.zip FreeBSD-src-6fa139d56eac8251b9a64c249c8e6fc8131f405c.tar.gz |
sh: Expand here documents in the current process.
Expand here documents at the same point other redirections are expanded but
use a non-fork subshell environment (like simple command substitutions) for
compatibility. Substitition errors result in an empty here document like
before.
As a result, a fork is avoided for short (<4K) expanded here documents.
Unexpanded here documents (with quoted end marker after <<) are not affected
by this change. They already only forked when >4K.
Side effects:
* Order of expansion is slightly different.
* Slow expansions are not executed in parallel with the redirected command.
* A non-fork subshell environment is subtly different from a forked process.
Diffstat (limited to 'bin/sh/nodetypes')
-rw-r--r-- | bin/sh/nodetypes | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/bin/sh/nodetypes b/bin/sh/nodetypes index ae4bc4a..5e70c64 100644 --- a/bin/sh/nodetypes +++ b/bin/sh/nodetypes @@ -138,6 +138,7 @@ NXHERE nhere # fd<<! next nodeptr # next redirection in list fd int # file descriptor being redirected doc nodeptr # input to command (NARG node) + expdoc temp char *expdoc # actual document (for NXHERE) NNOT nnot # ! command (actually pipeline) type int |