Skip to content

Using same session to modify enviroment #51

Open
@fdabrao

Description

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?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions