【发布时间】:2014-05-07 21:39:23
【问题描述】:
在尝试更好地了解 autoconf shell 脚本 (/usr/bin/autoconf) 的工作原理时,我遇到了以下几行:
174 if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
175
176 else
177 exitcode=1; echo positional parameters were not saved.
178 fi
然后在同一个脚本中:
500 # Run autom4te with expansion.
501 eval set x "$autom4te_options" \
502 --language=autoconf --output=\"\$outfile\" "$traces" \"\$infile\"
503 shift
504 $verbose && $as_echo "$as_me: running $AUTOM4TE $*" >&2
505 exec "$AUTOM4TE" "$@"
"set x" 似乎根本没有做任何事情,并且无论是否定义 x 都返回 0。
更令人困惑的是上面的 501-502 行,它们似乎也没有做任何事情
我错过了什么?
注意:不确定是否会有所不同,但在脚本前面已打开 posix 模式(set -o posix)
【问题讨论】: