diff options
author | jilles <jilles@FreeBSD.org> | 2011-06-12 23:06:04 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2011-06-12 23:06:04 +0000 |
commit | 91789615b49a87147298eee12c9b111d8c1b64c9 (patch) | |
tree | b1cbd950b159dbb3fa6211ba5a7f7fb7709a612e /bin/sh/sh.1 | |
parent | 5f2600c6a978923a3904716ce73814baca63fd0f (diff) | |
download | FreeBSD-src-91789615b49a87147298eee12c9b111d8c1b64c9.zip FreeBSD-src-91789615b49a87147298eee12c9b111d8c1b64c9.tar.gz |
sh: Save/restore changed variables in optimized command substitution.
In optimized command substitution, save and restore any variables changed by
expansions (${var=value} and $((var=assigned))), instead of trying to
determine if an expansion may cause such changes.
If $! is referenced in optimized command substitution, do not cause jobs to
be remembered longer.
This fixes $(jobs $!) again, simplifies the man page and shortens the code.
Diffstat (limited to 'bin/sh/sh.1')
-rw-r--r-- | bin/sh/sh.1 | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index f6682e6..3b7f3d3 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd June 10, 2011 +.Dd June 12, 2011 .Dt SH 1 .Os .Sh NAME @@ -1536,10 +1536,7 @@ except that the built-in commands and .Ic trap return information about the main shell environment -if they are the only command in a command substitution -and the substitutions in the command cannot cause side effects -(such as from assigning values to variables or referencing -.Li $! ). +if they are the only command in a command substitution. .Ss Arithmetic Expansion Arithmetic expansion provides a mechanism for evaluating an arithmetic expression and substituting its value. |