pgrep -f /bin/bash
osh timer 1 ^ \ f 't: (t, processes())' ^ \ expand 1 ^ f 't, p: (p.pid, int(t), p.commandline)' ^ sql "insert into process values(%s, %s, %s)"
- f 't: (t, processes())': Take the timestamp as input and generate a timestamp and sequence of Process objects.
- expand 1: Expand the sequence of Processes, so that there is one per output tuple, e.g. (123, (p1, p2)) -> (123, p1), (123, p2).
- f 't, p: (p.pid, int(t), p.commandline)': Take the timestamp and Process as input, and generate (pid, timestamp as int, command line) as output.
- sql "insert into process values(%s, %s, %s)": Take the triples from the previous command and dump them into a table in a database.