Permissions: -rwxr-xr-x
#!/bin/bashfunction upsearch () { test / == "$PWD" && return || test -e "$1" && echo "$PWD" && return || cd .. && upsearch "$1"}upsearch '.hg'