仅对组中的上一个`dbus-monitor`事件作出反应

时间:2018-09-30 20:19:29

标签: bash dbus

我正在编写一个脚本来对dbus-monitor做出反应,但是有一组17个事件记录在8/100秒内。我不想对所有17个事件作出反应。一秒或两秒之内不会发生假设另一个事件的最后一个事件。

我不确定如何在bash中编写代码吗?

示例事件日志(以grep压缩):

$ cat "dbus-monitor-plugin.txt" | grep time= | grep xrandr
method call time=1538331767.151461 sender=:1.59 -> destination=:1.11 serial=1242 path=/org/freedesktop/ColorManager/devices/xrandr_Toshiba_America_Info_Systems_Inc_TSB_TV_rick_1000; interface=org.freedesktop.DBus.Properties; member=GetAll
method call time=1538331767.151706 sender=:1.59 -> destination=:1.11 serial=1248 path=/org/freedesktop/ColorManager/devices/xrandr_Toshiba_America_Info_Systems_Inc_TSB_TV_rick_1000; interface=org.freedesktop.DBus.Properties; member=GetAll
method call time=1538331767.152338 sender=:1.59 -> destination=:1.11 serial=1252 path=/org/freedesktop/ColorManager/devices/xrandr_Sony_SONY_TV___00_16843009_rick_1000; interface=org.freedesktop.DBus.Properties; member=GetAll
method call time=1538331767.152597 sender=:1.59 -> destination=:1.11 serial=1255 path=/org/freedesktop/ColorManager/devices/xrandr_eDP_1_1_rick_1000; interface=org.freedesktop.DBus.Properties; member=GetAll
method call time=1538331767.152606 sender=:1.59 -> destination=:1.11 serial=1256 path=/org/freedesktop/ColorManager/devices/xrandr_Toshiba_America_Info_Systems_Inc_TSB_TV_rick_1000; interface=org.freedesktop.DBus.Properties; member=GetAll
method call time=1538331767.156892 sender=:1.59 -> destination=:1.11 serial=1263 path=/org/freedesktop/ColorManager/devices/xrandr_Sony_SONY_TV___00_16843009_rick_1000; interface=org.freedesktop.DBus.Properties; member=GetAll
method call time=1538331767.157062 sender=:1.59 -> destination=:1.11 serial=1264 path=/org/freedesktop/ColorManager/devices/xrandr_eDP_1_1_rick_1000; interface=org.freedesktop.DBus.Properties; member=GetAll
method call time=1538331767.157095 sender=:1.59 -> destination=:1.11 serial=1267 path=/org/freedesktop/ColorManager/devices/xrandr_Toshiba_America_Info_Systems_Inc_TSB_TV_rick_1000; interface=org.freedesktop.DBus.Properties; member=GetAll
method call time=1538331767.157699 sender=:1.59 -> destination=:1.11 serial=1271 path=/org/freedesktop/ColorManager/devices/xrandr_Sony_SONY_TV___00_16843009_rick_1000; interface=org.freedesktop.DBus.Properties; member=GetAll
method call time=1538331767.157707 sender=:1.59 -> destination=:1.11 serial=1272 path=/org/freedesktop/ColorManager/devices/xrandr_eDP_1_1_rick_1000; interface=org.freedesktop.DBus.Properties; member=GetAll
method call time=1538331767.158672 sender=:1.59 -> destination=:1.11 serial=1280 path=/org/freedesktop/ColorManager/devices/xrandr_Toshiba_America_Info_Systems_Inc_TSB_TV_rick_1000; interface=org.freedesktop.DBus.Properties; member=GetAll
method call time=1538331767.158788 sender=:1.59 -> destination=:1.11 serial=1284 path=/org/freedesktop/ColorManager/devices/xrandr_Sony_SONY_TV___00_16843009_rick_1000; interface=org.freedesktop.DBus.Properties; member=GetAll
method call time=1538331767.158954 sender=:1.59 -> destination=:1.11 serial=1286 path=/org/freedesktop/ColorManager/devices/xrandr_eDP_1_1_rick_1000; interface=org.freedesktop.DBus.Properties; member=GetAll
method call time=1538331767.159344 sender=:1.59 -> destination=:1.11 serial=1289 path=/org/freedesktop/ColorManager/devices/xrandr_Toshiba_America_Info_Systems_Inc_TSB_TV_rick_1000; interface=org.freedesktop.DBus.Properties; member=GetAll
method call time=1538331767.159867 sender=:1.59 -> destination=:1.11 serial=1295 path=/org/freedesktop/ColorManager/devices/xrandr_Sony_SONY_TV___00_16843009_rick_1000; interface=org.freedesktop.DBus.Properties; member=GetAll
method call time=1538331767.159946 sender=:1.59 -> destination=:1.11 serial=1296 path=/org/freedesktop/ColorManager/devices/xrandr_eDP_1_1_rick_1000; interface=org.freedesktop.DBus.Properties; member=GetAll
method call time=1538331767.159979 sender=:1.59 -> destination=:1.11 serial=1299 path=/org/freedesktop/ColorManager/devices/xrandr_Toshiba_America_Info_Systems_Inc_TSB_TV_rick_1000; interface=org.freedesktop.DBus.Properties; member=GetAll

0 个答案:

没有答案