Import 2.3.6pre2
[davej-history.git] / scripts / pathdown.sh
blob16c17b2a806776c880cb7fd67df6ecd2b179f176
1 #!/bin/sh
2 UP=
3 DN=${PWD:?}
4 TP=${TOPDIR:?}
6 while [ ! $TP/$UP/. -ef $DN ] ;do
7 UP=`basename $PWD`/$UP
8 cd ..
9 if [ "$PWD" = "/" ]; then echo "Lost"; exit 1; fi
10 done
12 echo $UP
13 exit 0