Skip to content

Commit fab8932

Browse files
authored
docs: fix wording and add shell example re: piping (#174)
1 parent 2058c79 commit fab8932

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,20 @@ user=> (-> @(process {:out :bytes} "head -c 10 /dev/urandom") :out seq)
205205
## Piping output
206206

207207
Both `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
209209
default, so you have to provide it with `{:out :string}` for the next process to
210210
capture the input, while `process` uses the default `java.lang.ProcessBuilder`
211211
setting 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+
214222
user=> (let [stream (-> (process "ls") :out)]
215223
@(process {:in stream
216224
:out :inherit} "cat")

0 commit comments

Comments
 (0)