########################################################################1# #2# This software is part of the ast package #3# Copyright (c) 1982-2011 AT&T Intellectual Property #4# and is licensed under the #5# Eclipse Public License, Version 1.0 #6# by AT&T Intellectual Property #7# #8# A copy of the License is available at #9# http://www.eclipse.org/org/documents/epl-v10.html #10# (with md5 checksum b35adb5213ca9657e911e9befb180842) #11# #12# Information and Software Systems Research #13# AT&T Research #14# Florham Park NJ #15# #16# David Korn <[email protected]> #17# #18########################################################################19function err_exit20{21print -u2 -n "\t"22print -u2 -r ${Command}[$1]: "${@:2}"23let Errors+=124}25alias err_exit='err_exit $LINENO'2627Command=${0##*/}28integer Errors=02930tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }31trap "cd /; rm -rf $tmp" EXIT3233PS3='ABC '3435cat > $tmp/1 <<\!361) foo372) bar383) bam39!4041select i in foo bar bam42do case $i in43foo) break;;44*) err_exit "select 1 not working"45break;;46esac47done 2> /dev/null <<!48149!5051unset i52select i in foo bar bam53do case $i in54foo) err_exit "select foo not working" 2>&355break;;56*) if [[ $REPLY != foo ]]57then err_exit "select REPLY not correct" 2>&358fi59( set -u; : $i ) || err_exit "select: i not set to null" 2>&360break;;61esac62done 3>&2 2> $tmp/2 <<!63foo64!6566exit $((Errors<125?Errors:125))676869