# Using a bi-directional pipe to read and write from 'cmd'

**URL:** <https://discourse.julialang.org/t/using-a-bi-directional-pipe-to-read-and-write-from-cmd/30313>\
**Category:** General Usage\
**Created:** [October 25, 2019, 6:23pm UTC](https://discourse.julialang.org/t/using-a-bi-directional-pipe-to-read-and-write-from-cmd/30313 "2019-10-25T18:23:42Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![tkf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkf/32/17635_2.png) [@tkf](https://discourse.julialang.org/u/tkf)\
**Post date:** [October 26, 2019, 3:20am UTC](https://discourse.julialang.org/t/using-a-bi-directional-pipe-to-read-and-write-from-cmd/30313/4 "2019-10-26T03:20:13Z")

</div>

I think you need at least one `@async` (see e.g., [Collecting all output from shell commands - #7 by tkf](https://discourse.julialang.org/t/collecting-all-output-from-shell-commands/15592/7)), unless there is some kind of a marker from the external process that indicates the end of multi-line response. But, if you need to deal with multiple requests and responses, I don’t think there is a way to reliably relate a chunk of output lines to a response. So, using `@async` may not solve the actual problem.

---

_[View the full topic](https://discourse.julialang.org/t/using-a-bi-directional-pipe-to-read-and-write-from-cmd/30313)._
