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