I have a go script for monitoring the rtsp protocol and I don’t understand how to make an expression search in the output after running the script. Made an approximate bash script -
#!/usr/bin/env bash if [ "$(sh run.sh | egrep '(RTSP/1.0) [0-9][0-9][0-9]' | tail -1)" ]; then echo OK #elif egrep 'qwert'; then # echo bad else echo ERROR fi I need if I found, say rtsp / 1.0 200, then write OK, and if we allow rtsp / 1.0 400, then BAD, etc. But run the script only once.
sh run.shto a temporary file and run grep on this file - Alexey Ten