xref: /freebsd/bin/sh/tests/builtins/cd2.0 (revision dd41de95a84d979615a2ef11df6850622bf6184e)
1# $FreeBSD$
2set -e
3
4L=$(getconf PATH_MAX / 2>/dev/null) || L=4096
5[ "$L" -lt 100000 ] 2>/dev/null || L=4096
6L=$((L+100))
7T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX)
8trap 'rm -rf ${T}' 0
9cd $T
10D=$T
11while [ ${#D} -lt $L ]; do
12	mkdir veryverylongdirectoryname
13	cd veryverylongdirectoryname
14	D=$D/veryverylongdirectoryname
15done
16[ $(pwd | wc -c) -eq $((${#D} + 1)) ] # +\n
17