freebsd-skq/tools
jilles 74d9b02bb0 sh: Don't do optimized command substitution if expansions have side effects.
Before considering to execute a command substitution in the same process,
check if any of the expansions may have a side effect; if so, execute it in
a new process just like happens if it is not a single simple command.

Although the check happens at run time, it is a static check that does not
depend on current state. It is triggered by:
- expanding $! (which may cause the job to be remembered)
- ${var=value} default value assignment
- assignment operators in arithmetic
- parameter substitutions in arithmetic except ${#param}, $$, $# and $?
- command substitutions in arithmetic

This means that $((v+1)) does not prevent optimized command substitution,
whereas $(($v+1)) does, because $v might expand to something containing
assignment operators.

Scripts should not depend on these exact details for correctness. It is also
imaginable to have the shell fork if and when a side effect is encountered
or to create a new temporary namespace for variables.

Due to the $! change, the construct $(jobs $!) no longer works. The value of
$! should be stored in a variable outside command substitution first.
2010-12-28 21:27:08 +00:00
..
build Document two more ways to find duplicates in the obsolete file list. 2010-12-04 11:40:40 +00:00
debugscripts Fix a couple of typos. 2010-07-30 11:58:18 +00:00
diag
kerneldoc - Update config to doxygen 1.5.2 (I use this with 1.5.9). 2009-08-24 13:10:55 +00:00
KSE Use, in uncovered part, the END() macro in order to improve debugging. 2009-05-25 14:37:10 +00:00
LibraryReport
regression sh: Don't do optimized command substitution if expansions have side effects. 2010-12-28 21:27:08 +00:00
sched - Update my copyright. 2009-01-22 06:21:30 +00:00
test Update for the new tests. 2010-08-21 14:14:24 +00:00
tools o Mount the device async when we're doing the copy. 2010-12-03 07:39:29 +00:00
install.sh
make_libdeps.sh Actualize. 2010-01-25 14:17:36 +00:00
README

$FreeBSD$

This directory tree contains tools used for the maintenance and
testing of FreeBSD.  There is no toplevel Makefile structure since
these tools are not meant to be built as part of the standard system,
though there may be individual Makefiles in some of the subdirs.

Please read the README files in the subdirs for further information.