Skip to content

Instantly share code, notes, and snippets.

@eginez
Created July 3, 2021 18:55
Show Gist options
  • Save eginez/27946ca622cd2b6553bbd9d0dacdb58d to your computer and use it in GitHub Desktop.
Save eginez/27946ca622cd2b6553bbd9d0dacdb58d to your computer and use it in GitHub Desktop.
Julia read stdout of proc
out = Pipe()
p = run(pipeline(`top`, stdout=out), wait=false)
## Now p is running in the background
## You can read out
output = String(read(out, 1024)) ## read() reads until eof, which is not what I need.
line = readline(out)
kill(p)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment