I have a stream A and a value B. The stream contains timestamps, the value B is a timestamp too. The stream A is updated sometimes with a new line, containing a new timestamp. The value of B remains constant.
The aim is to output a system message, as soon as time A is bigger than time B. This task should be done in bash.
My Idea is listening to file A using dbus-monitor "some arguments" | egrep --line-buffered "Timestamp:*" |
, followed by a while read -r line ; do
command.
Is it possible to implement two "real-time"-actions within a bash script? E.g. An EventHandler, in order to fire the system message, as soon as my condition is true? Or will I have to use cron? (The system message may also be delayed by two seconds…)