ONOS-737: regexp for grabbing OC* variables changed

Change-Id: Id5651ffb41230a39c6ed68e1605feaf3c0aa337b
diff --git a/tools/test/bin/onos-fetch-logs b/tools/test/bin/onos-fetch-logs
index a4d7ffe..4a866d6 100755
--- a/tools/test/bin/onos-fetch-logs
+++ b/tools/test/bin/onos-fetch-logs
@@ -30,7 +30,7 @@
 
 # Select the target
 if [ "${1}" = "--cell" ]; then
-    nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2)
+    nodes=$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2)
 else
     nodes=${1:-$OCI}
 fi
diff --git a/tools/test/bin/onos-intentperf-scrape b/tools/test/bin/onos-intentperf-scrape
index 8d698b1..401737e 100755
--- a/tools/test/bin/onos-intentperf-scrape
+++ b/tools/test/bin/onos-intentperf-scrape
@@ -6,7 +6,7 @@
 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
 . $ONOS_ROOT/tools/build/envDefaults
 
-nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2)
+nodes=$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2)
 
 for node in $nodes; do
     echo "fetching from ${node}..."
diff --git a/tools/test/bin/onos-iterm-cli b/tools/test/bin/onos-iterm-cli
index 85cee83..add607b 100755
--- a/tools/test/bin/onos-iterm-cli
+++ b/tools/test/bin/onos-iterm-cli
@@ -4,7 +4,7 @@
 #-------------------------------------------------------------------------------
 
 cellName=$ONOS_CELL
-nodeCount=$(env | egrep "OC[0-9]+" | wc -l | tr -d ' ')
+nodeCount=$(env | egrep "^OC[0-9]+" | wc -l | tr -d ' ')
 
 osascript -e "
 tell application \"iTerm\"
diff --git a/tools/test/bin/onos-iterm-logs b/tools/test/bin/onos-iterm-logs
index b160c6e..d1c93d6 100755
--- a/tools/test/bin/onos-iterm-logs
+++ b/tools/test/bin/onos-iterm-logs
@@ -4,7 +4,7 @@
 #-------------------------------------------------------------------------------
 
 cellName=$ONOS_CELL
-nodeCount=$(env | egrep "OC[0-9]+" | wc -l | tr -d ' ')
+nodeCount=$(env | egrep "^OC[0-9]+" | wc -l | tr -d ' ')
 
 osascript -e "
 tell application \"iTerm\"
diff --git a/tools/test/bin/onos-push-bits-through-proxy b/tools/test/bin/onos-push-bits-through-proxy
index e060a47..21cbddf 100755
--- a/tools/test/bin/onos-push-bits-through-proxy
+++ b/tools/test/bin/onos-push-bits-through-proxy
@@ -14,7 +14,7 @@
 echo "Pushing to proxy $node..."
 onos-push-bits $node
 
-others=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2 | grep -vE "^$OCT\$")
+others=$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2 | grep -vE "^$OCT\$")
 
 for other in $others; do
     echo "Pushing to $other..."
diff --git a/tools/test/bin/onos-push-update-bundle b/tools/test/bin/onos-push-update-bundle
index 85fa27b..a75769a 100755
--- a/tools/test/bin/onos-push-update-bundle
+++ b/tools/test/bin/onos-push-update-bundle
@@ -15,7 +15,7 @@
 
 echo "pushing bundle: $bundle"
 
-nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2)
+nodes=$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2)
 for node in $nodes; do
     scp -q $jar $ONOS_USER@$node:.m2/repository/$jar
     scp -q $jar $ONOS_USER@$node:$ONOS_INSTALL_DIR/$KARAF_DIST/system/$jar
diff --git a/tools/test/bin/onos-remove-raft-logs b/tools/test/bin/onos-remove-raft-logs
index 1f1e5c6..3a44963 100755
--- a/tools/test/bin/onos-remove-raft-logs
+++ b/tools/test/bin/onos-remove-raft-logs
@@ -6,7 +6,7 @@
 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
 . $ONOS_ROOT/tools/build/envDefaults
 
-nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2)
+nodes=$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2)
 
 onos-service --cell stop
 
diff --git a/tools/test/bin/onos-secure-ssh b/tools/test/bin/onos-secure-ssh
index 6109f7b..d869c67 100755
--- a/tools/test/bin/onos-secure-ssh
+++ b/tools/test/bin/onos-secure-ssh
@@ -17,7 +17,7 @@
 let OPC=$OPTIND-1
 shift $OPC
 
-nodes=${1:-$(env | sort | egrep "OC[0-9]+" | cut -d= -f2)}
+nodes=${1:-$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2)}
 
 for node in $nodes; do
     # Prune the node entry from the known hosts file since server key changes
diff --git a/tools/test/bin/onos-service b/tools/test/bin/onos-service
index eab52ed..d65b521 100755
--- a/tools/test/bin/onos-service
+++ b/tools/test/bin/onos-service
@@ -36,7 +36,7 @@
     start|stop|restart|status)
         # Select the target
         if [ "${1}" = "--cell" ]; then
-            nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2)
+            nodes=$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2)
         else
             nodes=$(find_node ${1:-$OCI})
         fi
diff --git a/tools/test/bin/onos-show-cell b/tools/test/bin/onos-show-cell
index f5c7572..bc54240 100755
--- a/tools/test/bin/onos-show-cell
+++ b/tools/test/bin/onos-show-cell
@@ -43,7 +43,7 @@
 echo "ONOS_CELL=${ONOS_CELL}"
 echo "ONOS_NIC=${ONOS_NIC}"
 # get number of OC variables
-max=$( env | egrep 'OC[0-9]+' | wc -l )
+max=$( env | egrep '^OC[0-9]+' | wc -l )
 for n in $( seq 0 ${max} ); do
     ocn="OC${n}"
     if [ -n "${!ocn}" ]; then
diff --git a/tools/test/bin/onos-start-network b/tools/test/bin/onos-start-network
index 5412e09..083262d 100755
--- a/tools/test/bin/onos-start-network
+++ b/tools/test/bin/onos-start-network
@@ -36,4 +36,4 @@
 $SCPCMD $ONOS_ROOT/tools/test/topos/* $ONOS_USER@$OCN:topos/
 
 echo "Starting Network."
-$SSHCMD -t $ONOS_USER@$OCN sudo python $topo $(env | sort | egrep "OC[0-9]+" | cut -d= -f2)
+$SSHCMD -t $ONOS_USER@$OCN sudo python $topo $(env | sort | egrep "^OC[0-9]+" | cut -d= -f2)
diff --git a/tools/test/bin/onos-topo-cfg-all b/tools/test/bin/onos-topo-cfg-all
index 033dfbd..b26d6a8 100755
--- a/tools/test/bin/onos-topo-cfg-all
+++ b/tools/test/bin/onos-topo-cfg-all
@@ -8,7 +8,7 @@
 
 echo "This facility has been deprecated and will be removed in 1.6.0 (Goldeneye) release!!!"
 
-nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2)
+nodes=$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2)
 
 for node in $nodes; do
     printf "$node..."
diff --git a/tools/test/bin/onos-verify-cell b/tools/test/bin/onos-verify-cell
index dad9063..33f9565 100755
--- a/tools/test/bin/onos-verify-cell
+++ b/tools/test/bin/onos-verify-cell
@@ -6,6 +6,6 @@
 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
 . $ONOS_ROOT/tools/build/envDefaults
 
-for node in $OCT $OCN $(env | sort | egrep "OC[0-9]+" | cut -d= -f2); do
+for node in $OCT $OCN $(env | sort | egrep "^OC[0-9]+" | cut -d= -f2); do
     printf "%s: " $node; ssh -n -o StrictHostKeyChecking=no -o PasswordAuthentication=no $ONOS_USER@$node hostname
 done