]> git.saurik.com Git - apple/shell_cmds.git/blob - sh/tests/builtins/cd8.0
shell_cmds-216.60.1.tar.gz
[apple/shell_cmds.git] / sh / tests / builtins / cd8.0
1 # $FreeBSD: head/bin/sh/tests/builtins/cd8.0 230095 2012-01-13 23:32:27Z jilles $
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