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