Skip to content

Peeking into processes that are still running #6

@yakir12

Description

@yakir12

How can I read the output of a process that hasn't (and never will) exit/end?

Consider the following example:

using OutputCollectors

script = raw"""
declare -i i=0
while TRUE
do
    i+=1
    echo "Line #$i"
    sleep 1
done
"""

oc = OutputCollector(`sh -c $script`)

Unsurprisingly, running tail(oc) for instance will never return.

Is there any way to retrieve the output "up to now"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions