linux-old/scripts/pathdown.sh
<<
>>
Prefs
   1#!/bin/sh
   2UP=
   3DN=${PWD:?}
   4TP=${TOPDIR:?}
   5
   6while [ ! $TP/$UP/. -ef $DN ] ;do
   7        UP=`basename $PWD`/$UP
   8        cd ..
   9        if [ "$PWD" = "/" ]; then echo "Lost"; exit 1; fi
  10done
  11
  12echo $UP
  13exit 0
  14
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.