Skip to content

Commit

Permalink
updated doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jlangch committed Sep 14, 2023
1 parent fd56840 commit 8d9d39c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions doc/readme/shell-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ underlying operating system (see the Venice _cheatsheet_ for details).
(println (with-sh-dir "/tmp" (sh "ls" "-l") (sh "pwd")))
(println (sh "pwd" :dir "/tmp"))

;; asynchronously slurping stdout and stderr from a unix shell command
(sh "/bin/sh" "-c" "for i in {1..5}; do sleep 1; echo \"Hello $i\"; done"
:out-fn println
:err-fn println)

;; asynchronously slurping stdout and stderr from a unix shell command with timeout
(sh "/bin/sh" "-c" "for i in {1..5}; do sleep 1; echo \"Hello $i\"; done"
:out-fn println
:err-fn println
:timeout 2500)

;; list files in a directory with a glob pattern
(->> (io/list-files-glob "." "*.png")
(docoll println))
Expand Down

0 comments on commit 8d9d39c

Please sign in to comment.