Skip to content

Commit 3bfb382

Browse files
filchristouSeelengrabvtjnashKristofferC
authored
Docs for reading external command from custom buffer (#53652)
--------- Co-authored-by: Sukera <[email protected]> Co-authored-by: Jameson Nash <[email protected]> Co-authored-by: Kristoffer Carlsson <[email protected]>
1 parent 1a3a1f4 commit 3bfb382

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

doc/src/manual/running-external-programs.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ julia> `echo "foo bar"`[2]
7979
"foo bar"
8080
```
8181

82+
You can also pass a `IOBuffer`, and later read from it:
83+
84+
```jldoctest
85+
julia> io = PipeBuffer(); # PipeBuffer is a type of IOBuffer
86+
87+
julia> run(`echo world`, devnull, io, stderr);
88+
89+
julia> readlines(io)
90+
1-element Vector{String}:
91+
"world"
92+
```
93+
8294
## [Interpolation](@id command-interpolation)
8395

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

0 commit comments

Comments
 (0)