Fixing the bash_profile 'o' function to prefer shorter paths.

Change-Id: If874e6a9c885f48bc1fcf0b19262f7b44a094323
(cherry picked from commit 49367a6a3f699f905f0489bcc11272d6691d4b4d)
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)