]> git.saurik.com Git - apple/shell_cmds.git/blob - sh/tests/builtins/cd2.0
shell_cmds-216.60.1.tar.gz
[apple/shell_cmds.git] / sh / tests / builtins / cd2.0
1 # $FreeBSD: head/bin/sh/tests/builtins/cd2.0 216019 2010-11-28 22:49:58Z jilles $
2 set -e
3
4 L=$(getconf PATH_MAX / 2>/dev/null) || L=4096
5 [ "$L" -lt 100000 ] 2>/dev/null || L=4096
6 L=$((L+100))
7 T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX)
8 trap 'rm -rf ${T}' 0
9 cd $T
10 D=$T
11 while [ ${#D} -lt $L ]; do
12 mkdir veryverylongdirectoryname
13 cd veryverylongdirectoryname
14 D=$D/veryverylongdirectoryname
15 done
16 [ $(pwd | wc -c) -eq $((${#D} + 1)) ] # +\n