summaryrefslogtreecommitdiffstats
path: root/uClinux-2.4.31-uc0/scripts/pathdown.sh
blob: 97424c2208297a633c1f17e4d39924b8c77cf63e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
UP=
DN=${PWD:?}
TP=${TOPDIR:?}

if [ "$VIRTUAL_TOPDIR" ]; then
TP=${VIRTUAL_TOPDIR:?}
fi

while [ ! $TP/$UP/. -ef $DN ] ;do
	UP=`basename $PWD`/$UP
	cd ..
	if [ "$PWD" = "/" ]; then echo "Lost"; exit 1; fi
done

echo $UP
exit 0