mirror of
git://git.sv.gnu.org/autoconf
synced 2025-03-13 14:36:50 +08:00
(Limitations of Builtins): Describe "set -" problems.
This commit is contained in:
parent
c3544003c0
commit
312fdf3750
@ -11180,9 +11180,14 @@ processing as soon as a non-option argument is found. Therefore, use
|
||||
set x $my_list; shift
|
||||
@end example
|
||||
|
||||
Some shells have the "opposite" problem of not recognizing all options
|
||||
Avoid @samp{set -}, e.g., @samp{set - $my_list}. POSIX 1003.1-2001 no
|
||||
longer requires support for this command, and in traditional shells
|
||||
@samp{set - $my_list} resets the @samp{-v} and @samp{-x} options, which
|
||||
makes scripts harder to debug.
|
||||
|
||||
Some nonstandard shells do not recognize more than one option
|
||||
(e.g., @samp{set -e -x} assigns @samp{-x} to the command line). It is
|
||||
better to elide these:
|
||||
better to combine them:
|
||||
|
||||
@example
|
||||
set -ex
|
||||
|
Loading…
x
Reference in New Issue
Block a user