Last active
May 25, 2024 10:20
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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