die() {
local c=${1:--1} m=${2:-'Died'}
echo "$m at ${BASH_SOURCE[1]}:${FUNCNAME[1]} line ${BASH_LINENO[0]} (exit $c)" >&2
exit $c
}
call() { local rc; set -x; "$@"; rc=$?; { set +x; } 2>/dev/null; return $rc; }
call "$opt_rhapsodycl" -f $rclfile || die $? 'Rhapsody license server not reachable'
例如,在输出失败的情况下,输出如下内容:
+ path/to/RhapsodyCL.exe -f configuration.rcl
+ rc=127
Rhapsody license server not reachable at ./Build:main line 167 (exit 127)