xref: /freebsd/bin/sh/tests/expansion/pathname3.0 (revision d8a0fe102c0cfdfcd5b818f850eff09d8536c9bc)
1# $FreeBSD$
2
3v=12345678
4v=$v$v$v$v
5v=$v$v$v$v
6v=$v$v$v$v
7v=$v$v$v$v
8v=$v$v$v$v
9# 8192 bytes
10v=${v##???}
11[ /*/$v = "/*/$v" ] || exit 1
12
13s=////
14s=$s$s$s$s
15s=$s$s$s$s
16s=$s$s$s$s
17s=$s$s$s$s
18# 1024 bytes
19s=${s##??????????}
20[ /var/empt[y]/$s/$v = "/var/empt[y]/$s/$v" ] || exit 2
21while [ ${#s} -lt 1034 ]; do
22	set -- /.${s}et[c]
23	[ ${#s} -gt 1018 ] || [ "$1" = /.${s}etc ] || exit 3
24	set -- /.${s}et[c]/
25	[ ${#s} -gt 1017 ] || [ "$1" = /.${s}etc/ ] || exit 4
26	set -- /.${s}et[c]/.
27	[ ${#s} -gt 1016 ] || [ "$1" = /.${s}etc/. ] || exit 5
28	s=$s/
29done
30