I'm trying to run
WID=`xdotool search "Inbox" | head -1` xdotool windowactivate $WID xdotool key Up
each time stdout of
$ CAMEL_DEBUG=all evolution
yields "starting idle".
I've come up with this script, which does what I want, but only once, it isn't doing it every time "starting idle" is shown, but only once and stops. I don't know bash good enough to force it to repeat itself endlessly.
exec 3< <(CAMEL_DEBUG=all evolution) while read line; do case "$line" in *"starting idle"*) echo "'$line' contains staring idle" WID=`xdotool search "Inbox" | head -1` xdotool windowactivate $WID xdotool key Up break ;; *) echo "'$line' does not contain starting idle." ;; esac done <&3 exec 3<&-