Skip to content

Instantly share code, notes, and snippets.

@shirok
Created January 20, 2015 06:21
Show Gist options
  • Save shirok/10e913083142cd928a7a to your computer and use it in GitHub Desktop.
Save shirok/10e913083142cd928a7a to your computer and use it in GitHub Desktop.
shiro@scherzo:~/src$ gosh ./t.scm 3>c > >(tee a >&3) 2> >(tee b >&3)
shiro@scherzo:~/src$ cat a
out
out
out
out
out
out
out
out
out
out
shiro@scherzo:~/src$ cat b
err
err
err
err
err
err
err
err
err
err
shiro@scherzo:~/src$ cat c
err
err
err
err
out
err
err
err
out
err
shiro@scherzo:~/src$
(let loop ((n 0))
(when (< n 10)
(display "out\n" (current-output-port)) (flush)
(display "err\n" (current-error-port))
(sys-sleep 1)
(loop (+ n 1))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment