]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - tools/regression/bin/sh/builtins/cd8.0
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / tools / regression / bin / sh / builtins / cd8.0
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
6 LC_ALL=C
7 export LC_ALL
8 r=0
9
10 t() {
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
24 t /dev/tty
25 t /dev/tty/x
26 exit $r