
#   awk script to parse out and return top directory

BEGIN {
    topdirectory="/usr/local/mathematica"
}

/topdir=/ {
    pos = index($0, "=")
    topdirectory=substr($0, pos+1)
}

END {
    print topdirectory
}
