Skip to content

Commit

Permalink
Docs for reading external command from custom buffer (#53652)
Browse files Browse the repository at this point in the history

---------

Co-authored-by: Sukera <11753998+Seelengrab@users.noreply.github.com>
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
Co-authored-by: Kristoffer Carlsson <kcarlsson89@gmail.com>
  • Loading branch information
4 people authored May 30, 2024
1 parent 1a3a1f4 commit 3bfb382
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doc/src/manual/running-external-programs.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,18 @@ julia> `echo "foo bar"`[2]
"foo bar"
```

You can also pass a `IOBuffer`, and later read from it:

```jldoctest
julia> io = PipeBuffer(); # PipeBuffer is a type of IOBuffer
julia> run(`echo world`, devnull, io, stderr);
julia> readlines(io)
1-element Vector{String}:
"world"
```

## [Interpolation](@id command-interpolation)

Suppose you want to do something a bit more complicated and use the name of a file in the variable
Expand Down

0 comments on commit 3bfb382

Please sign in to comment.