Skip to content

Instantly share code, notes, and snippets.

@mattmoss
Created November 13, 2012 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattmoss/4063931 to your computer and use it in GitHub Desktop.
Save mattmoss/4063931 to your computer and use it in GitHub Desktop.
Losing lines from process :out
(ns user (:require [conch.core :as sh]))
;; p is a process returned from (sh/proc ...)
(defn read-lines-until [p re]
(loop [line (sh/read-line p :out)]
(when line
(if-let [match (re-find re line)]
match
(recur (sh/read-line p :out))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment