egrep needed for parens
diff --git a/tools/build_uec.sh b/tools/build_uec.sh
index 44c8c0f..ada6596 100755
--- a/tools/build_uec.sh
+++ b/tools/build_uec.sh
@@ -227,7 +227,7 @@
     trap kill_tail SIGINT
 
     echo "Waiting stack.sh to finish..."
-    while ! cat $vm_dir/console.log | grep -q '^stack.sh (completed|failed)' ; do
+    while ! egrep -q '^stack.sh (completed|failed)' $vm_dir/console.log ; do
         sleep 1
     done