1 2# The exact wording of the error message is not standardized, but giving 3# a description of the errno is useful. 4 5LC_ALL=C 6export LC_ALL 7r=0 8 9t() { 10 exec 3>&1 11 errmsg=`cd "$1" 2>&1 >&3 3>&-` 12 exec 3>&- 13 case $errmsg in 14 *[Nn]ot\ a\ directory*) 15 ;; 16 *) 17 printf "Wrong error message for %s: %s\n" "$1" "$errmsg" 18 r=3 19 ;; 20 esac 21} 22 23t /dev/tty 24t /dev/tty/x 25exit $r 26