Skip to content

Commit d912506

Browse files
committed
Fix ns and escaping in readme
1 parent adbca58 commit d912506

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

README.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,37 @@ SSH in clojure. Uses jsch.
88

99
The `clj-ssh.cli` namespace provides some functions for ease of use at the REPL.
1010

11-
(use 'clj-ssh.ssh)
11+
```clj
12+
(use 'clj-ssh.cli)
13+
```
1214

13-
Use `ssh` to execute a command, say `ls`, on a remote host \"my-host\",
15+
Use `ssh` to execute a command, say `ls`, on a remote host "my-host",
1416

15-
(ssh \"my-host\" \"ls\")
16-
=> {:exit 0 :out \"file1\\nfile2\\n\" :err \"\")
17+
```clj
18+
(ssh "my-host" "ls")
19+
=> {:exit 0 :out "file1\nfile2\n" :err "")
20+
```
1721

1822
By default this will use the system ssh-agent to obtain your ssh keys, and it
1923
uses your current username, but this can be specified:
2024

21-
(ssh \"my-host\" \"ls\" :username \"remote-user\")
22-
=> {:exit 0 :out \"file1\\nfile2\\n\" :err \"\")
25+
```clj
26+
(ssh "my-host" "ls" :username "remote-user")
27+
=> {:exit 0 :out "file1\nfile2\n" :err "")
28+
```
2329

2430
Strict host key checking can be turned off:
2531

26-
(default-session-options {:strict-host-key-checking :no})
32+
```clj
33+
(default-session-options {:strict-host-key-checking :no})
34+
```
2735

2836
SFTP is also supported. For example, to copy a local file to a remote host
29-
\"my-host\":
37+
"my-host":
3038

31-
(sftp \"my-host\" :put \"/from/this/path\" \"to/this/path\")
39+
```clj
40+
(sftp "my-host" :put "/from/this/path" "to/this/path")
41+
```
3242

3343
Note that any sftp commands that change the state of the sftp session (such as
3444
cd) do not work with the simplified interface, as a new session is created each

0 commit comments

Comments
 (0)