use dialect-agnostic regexes in onos scripts

Change-Id: Ifd828fd2bc130598d796ac4d786c77ba31365d8e
diff --git a/tools/dev/bin/onos-build-selective b/tools/dev/bin/onos-build-selective
index 351c53a..c3ea6fa 100755
--- a/tools/dev/bin/onos-build-selective
+++ b/tools/dev/bin/onos-build-selective
@@ -7,7 +7,7 @@
 
 projects=$(find $ONOS_ROOT -type f -path '*/src/*' \
     -exec $ONOS_ROOT/tools/dev/bin/onos-build-selective-hook {} \; | \
-        grep -v -f $ONOS_ROOT/tools/dev/bin/onos-build-selective.exclude | \
+        egrep -v -f $ONOS_ROOT/tools/dev/bin/onos-build-selective.exclude | \
         sort -u | sed "s:$ONOS_ROOT::g" | tr '\n' ',' | \
         sed 's:/,:,:g;s:,/:,:g;s:^/::g;s:,$::g')
 
@@ -16,7 +16,7 @@
     modulesERE=""
     for pd in ${projects//,/ }; do
         if [ -f ${pd}/pom.xml ]; then
-            artifactId=$(grep -E "^    <artifactId>.*</artifactId>$" ${pd}/pom.xml | \
+            artifactId=$(egrep -E "^    <artifactId>.*</artifactId>$" ${pd}/pom.xml | \
                             sed 's/.[^>]*>//;s/<.*//')
             modulesERE="$modulesERE|$artifactId"
         fi
@@ -26,7 +26,7 @@
     # Search through staged app.xml files for any apps that require one or
     # more of the modified artifacts.
     appProjects=$(find $ONOS_ROOT -type f -path '*/target/oar/app.xml' | \
-            xargs grep '<artifact>' | grep -E "/($modulesERE)/" | \
+            xargs egrep '<artifact>' | egrep -E "/($modulesERE)/" | \
             cut -d: -f1 | sed 's:/target/oar/.*::g' | \
             sort -u | sed "s:$ONOS_ROOT::g" | tr '\n' ',' | \
             sed 's:/,:,:g;s:,/:,:g;s:^/::g;s:,$::g')
diff --git a/tools/dev/bin/onos-setup-karaf b/tools/dev/bin/onos-setup-karaf
index 84e9c94..5ff7279 100755
--- a/tools/dev/bin/onos-setup-karaf
+++ b/tools/dev/bin/onos-setup-karaf
@@ -17,7 +17,7 @@
 # Validates the specified IP regular expression against existing adapters.
 # Excludes local-loopback.
 function validateIp {
-    ifconfig | awk '{ print $2}' | grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}" | grep $1
+    ifconfig | sed -ne 's:inet[^6][ adr:]*\([0-9.]*\).*:\1: p' | grep $1
 }
 
 # Parse optional arguments