S6-FTRIG-LISTEN(8)

NAME
s6-ftrig-listen - subscribe to several s6-fifodir(7)s, spawn a program, then wait for pattern of events to occur on the fifodirs

SYNOPSIS
In an execlineb(1) script:

s6-ftrig-listen [-a | -o] [-t timeout] { fifodir-1 regexp-1 fifodir-2 regexp-2 } prog...

DESCRIPTION
s6-ftrig-listen subscribes to fifodir1 with the regexp regexp1, to fifodir2 with the regexp regexp2, and so on.

It then forks and execs prog... with all its arguments.

It waits for the series of events received on fifodir-i to match regexp-i. regexp-i must be Extended Regular Expressions[1].

When the series of read events matches the regexps, s6-ftrig-listen exits 0. s6-ftrig-listen can be used outside of an execlineb script by using the internal argv syntax, but this syntax is an implementation detail and is not documented as stable. In a shell script, use ‘execlineb -Pc 's6-ftrig-listen ...'’ to get the benefits of the execlineb brace syntax.

OPTIONS

-t timeout
    If the events on the fifodirs have not matched the regexps after timeout milliseconds, print an error message on stderr and exit 1. By default, s6-ftrig-listen waits indefinitely for a matching series of events.

-a  And (conjunction). s6-ftrig-listen will only exit when all the fifodir-i have been notified with events matching the corresponding regexp-i. This is the default.

-o  Or (disjunction). s6-ftrig-listen will exit as soon as one of the fifodir-i has been notified with events matching its regexp-i.

SEE ALSO
execlineb(1), s6-cleanfifodir(8), s6-ftrig-listen1(8), s6-ftrig-notify(8), s6-ftrig-wait(8), s6-ftrigrd(8), s6-mkfifodir(8)

[1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_04

This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6/s6-ftrig-listen.html

AUTHORS
Laurent Bercot Alexis <flexibeast@gmail.com> (man page port)