clj-commons / clj-commons/clj-ssh

Using same session to modify enviroment

Open
#51 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Clojure
Stars
241
Forks
66
PR merge metrics
No merged PRs in 30d

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?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the session, with-connection, and ssh entry points to determine whether commands share a shell process or only an SSH connection. Reproduce the two-command example and consider the work complete when a supported way for TEST to persist between commands is documented or available.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.