]> git.saurik.com Git - apple/shell_cmds.git/blame - sh/tests/builtins/cd3.0
shell_cmds-216.60.1.tar.gz
[apple/shell_cmds.git] / sh / tests / builtins / cd3.0
CommitLineData
deb63bfb 1# $FreeBSD: head/bin/sh/tests/builtins/cd3.0 222154 2011-05-20 22:55:18Z jilles $
71aad674
A
2
3# If fully successful, cd -Pe must be like cd -P.
4
5set -e
6
7cd "${TMPDIR:-/tmp}"
8cd -Pe /
9[ "$PWD" = / ]
10[ "$(pwd)" = / ]
11cd "${TMPDIR:-/tmp}"
12cd -eP /
13[ "$PWD" = / ]
14[ "$(pwd)" = / ]
15
16set +e
17
18# If cd -Pe cannot chdir, the exit status must be greater than 1.
19
20v=$( (cd -Pe /var/empty/nonexistent) 2>&1 >/dev/null)
21[ $? -gt 1 ] && [ -n "$v" ]