#!/bin/bash # set -e # make sure to source ros work space so we can use the rostopic command # source stuff source /home/ssher/.bashrc FILE="./resp.txt" OUT="confirm" until [[ $OUT != "confirm" ]] do rostopic list &> $FILE echo $OUT OUT=$(awk '/ERR/ { print "confirm" }' $FILE) sleep 1 done echo "found roscore!" rm $FILE # exit 1