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