add optional arg to specify events to monitor
alternative to process substitution plus other multiplatform fixes