             (when-not (= exit 0) 
               (throw+ (merge res {:type ::execute-failed :exit exit} (meta b))))))
         ))))
-
 
 (defn fname [uri] (-> uri (split '#"/") last))
 

(defn put 
  "Copies a file into host under dest"
  [host file dest]
  (with-session host 22
    (fn [session]
      (let [channel (ssh-sftp session)]
        (with-channel-connection channel

  (doseq [line (line-seq (clojure.java.io/reader out))] (debug line))
  ) 

(defn execute [opts & batches]
  {:pre [(every? sequential? batches)]}
  "Executes remotly using ssh for example: (execute {:host \"192.168.20.171\"} [\"ls\"])"
  (doseq [b batches]
    (with-session opts
      (fn [session]
        (let [{:keys [channel out-stream] :as res} (ssh session {:in  (join "\n" b)  :out :stream :agent-forwarding false})]
          (log-output out-stream)
