rm -f tape.x tape.y tape.sh >/dev/null
if $0 = stpdir goto stp
tp $1t >tape.x
goto tp
: stp
stp $1t >tape.x
: tp
ed - tape.x
v/\//d
w
q
set a = 8
: loop
ed - tape.x
g/^/s/\(.*\)\/.*/\1/
w
q
cat tape.y >>tape.x
usort tape.x >tape.y
set a - 1
if $a = 0 goto stop
cp tape.y tape.x
goto loop
: stop
ed - tape.y
g/^$/d
g/^\.$/d
g/^/s//mkdir /
w
q
mv tape.y tape.sh
rm tape.x
