Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active May 25, 2024 10:20
Show Gist options
  • Save dacr/d655f00ed01f12411c02672f89e49ac4 to your computer and use it in GitHub Desktop.
Save dacr/d655f00ed01f12411c02672f89e49ac4 to your computer and use it in GitHub Desktop.
hello world 2 through ssh / published by https://github.com/dacr/code-examples-manager #91da1865-2b00-4737-a425-a2cda8b9c7e7/6a10fa96c87946a6a3897acdb0cd20d9561b252f
// summary : hello world 2 through ssh
// keywords : scala, ssh, jsch, dsl, helloworld
// publish : gist
// authors : David Crosson
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2)
// id : 91da1865-2b00-4737-a425-a2cda8b9c7e7
// created-on : 2023-11-18T00:03:42+01:00
// managed-by : https://github.com/dacr/code-examples-manager
// run-with : scala-cli $file
// ---------------------
//> using scala "3.4.2"
//> using dep "fr.janalyse::janalyse-ssh:1.1.0"
//> using lib "org.slf4j:slf4j-nop:2.0.9"
// ---------------------
jassh.SSH.shell("localhost", "test") { sh =>
import sh.*
println(s"initial directory is $pwd")
cd("/tmp")
println(s"now it is $pwd")
println(echo("Hello world !"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment