clj-commons/clj-ssh

Using same session to modify enviroment

fdabrao opened this issue · 0 comments

Hello,

Is there any way to do this

(let [agent (ssh-agent {})]
  (let [session (session agent "host-ip" {:strict-host-key-checking :no})]
    (with-connection session
      (let [result (ssh session {:cmd "export TEST=1"})]
        (println (result :out)))
      (let [result (ssh session {:cmd "echo $TEST"})]
        (println (second result)))))))

and the echo $TEST equals to 1? I tried the last code but the result of last print is empty. Is there any way to use the same session?