Fixing the bash_profile 'o' function to prefer shorter paths.
Change-Id: If874e6a9c885f48bc1fcf0b19262f7b44a094323
diff --git a/tools/dev/bash_profile b/tools/dev/bash_profile
index 15dcd07..3a3c3c6 100644
--- a/tools/dev/bash_profile
+++ b/tools/dev/bash_profile
@@ -51,7 +51,7 @@
# e.g. 'o api', 'o dev', 'o'
function o {
cd $(find $ONOS_ROOT/ -type d -and \( -name 'buck-out' -o -name '.git' -o -name 'target' -o -name 'gen-src' -o -name 'src' \) -prune -o -type d | \
- egrep "${1:-$ONOS_ROOT}" | head -n 1)
+ egrep "${1:-$ONOS_ROOT}" | awk '{print length($1)"\t"$1}' | sort -n | cut -f2 | head -n 1)
}
# Buck (if "buck" is not on the PATH)