File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -205,12 +205,20 @@ user=> (-> @(process {:out :bytes} "head -c 10 /dev/urandom") :out seq)
205205## Piping output
206206
207207Both ` shell ` and ` process ` support piping output from one process to the next
208- using but note that ` shell ` writes the output to the system's stdout by
208+ using ` :in ` , but note that ` shell ` writes the output to the system's stdout by
209209default, so you have to provide it with ` {:out :string} ` for the next process to
210210capture the input, while ` process ` uses the default ` java.lang.ProcessBuilder `
211211setting which defaults to writing to a stream:
212212
213213``` clojure
214+ user=> (let [ls-result (shell {:out :string } " ls" )]
215+ (shell {:in (:out ls-result)} " grep md" ))
216+
217+ API.md
218+ CHANGELOG.md
219+ README.md
220+ ...
221+
214222user=> (let [stream (-> (process " ls" ) :out )]
215223 @(process {:in stream
216224 :out :inherit } " cat" )
You can’t perform that action at this time.
0 commit comments