dbus-monitor and awk

Jesse W jessw at netwood.net
Wed Sep 2 17:30:58 PDT 2009


On Sep 2, 2009, at 4:35 PM, spitfire23bc wrote:
> Hi all, I'm trying to write a bash script that will listen for specific
> events on dbus and run commands depending on those events. I've been 
> using
...
> On the author's Fedora 10 system, this gives an output whenever a 
> Tomboy
> note is created, saved or deleted. On Ubuntu 8.10, it gives no output.
...
> works fine; it is the pipe to the awk command that kills any kind of 
> output.
>
> When the output from the dbus-monitor command is saved to a file and 
> the
> same awk command run on that file, it gives the expected output.
>
> Is there a way to get awk to run commands whilst dbus-monitor is still
> going, as is the purpose of this script?
Yes, although as you realized, this is not a dbus (or dbus-monitor) 
problem.  Per `man awk`, if you add -W interactive to the awk command, 
it will do unbuffered reads, and therefore work.

Thanks for asking a question I was able to (figure out how to) answer!

Jesse Weinstein



More information about the dbus mailing list