Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Peeking into processes that are still running #6

Open
yakir12 opened this issue Nov 10, 2022 · 0 comments
Open

Peeking into processes that are still running #6

yakir12 opened this issue Nov 10, 2022 · 0 comments

Comments

@yakir12
Copy link

yakir12 commented Nov 10, 2022

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"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant