Run Shell event shall be fired when a shell command prints to its standard output (stdout) a line matching a pattern.
Example:
event Run Shell [ Command: getevent Line:*00000004 Use Root:On ]
The typical usage is to monitor keypresses (via getevent utility) and system log records (via logcat utility).
Note: An implementation should ensure that the line buffering only is performed by an operating system and run time libraries. Any other buffering would make the event meaningless.
Perhaps, a virtual terminal (pty) is the best IPC to be used.
Automagic implements Command Output trigger, see http://automagic4android.com/en/help/components-triggers#trigger_command_output but the triiger may