Linux Audio
Check our new training course
Embedded Linux Audio
1 2 3 4 5 6 7 8 9 10 11 12 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