File: reldir

package info (click to toggle)
openbios-sparc 1.0%2Bsvn640-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 4,412 kB
  • ctags: 12,091
  • sloc: ansic: 57,249; asm: 2,680; xml: 1,335; cpp: 414; makefile: 224; sh: 190
file content (10 lines) | stat: -rwxr-xr-x 244 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh

PREF="."
for x in 0 1 2 3 4 5 6 7 ; do
    test -f $PREF/config/configure.in && break
    PREF="../$PREF"
done
ROOT=$( echo $(pwd) | sed "s,\(//*[^/][^/]*\)\{$x\}/*\$,," )
RELNAME=$( echo $(pwd) | sed "s,^$ROOT/*,,g" )
echo $RELNAME