patch-1.3.19 linux/scripts/pathdown.sh

Next file: linux/CREDITS
Previous file: linux/scripts/hfiles.sh
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.18/linux/scripts/pathdown.sh linux/scripts/pathdown.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+UP=
+DN=${PWD:?}
+TP=${TOPDIR:?}
+
+while [ ! $TP/$UP/. -ef $DN ] ;do
+	UP=`basename $PWD`/$UP
+	cd ..
+	if [ "$PWD" = "/" ]; then echo "Lost"; exit 1; fi
+done
+
+echo $UP
+exit 0


FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this