I’m sure there’s some trivial one-liner with perl, ruby, bash whatever that would let me run a command in a loop until I observe some string in stdout, then stop. Ideally, I’d like to capture stdout as well, but if it’s going to console, that might be enough.
The particular environment in question at the moment is RedHat Linux but need same thing on Mac sometimes too. So something, generic and *nixy would be best. Don’t care about Windows – presumably a *nixy thing would work under cygwin.
UPDATE: Note that by ‘observe some string’ I mean ‘stdout contains some string’ not ‘stdout IS some string’.
In Perl:
Example:
You might want to add a sleep in there, though.