This page is no longer maintained — Please continue to the home page at www.scala-lang.org

scala-ssh-shell

4 replies
srparish
Joined: 2011-10-09,
User offline. Last seen 42 years 45 weeks ago.

To those who've asked about having an embedded shell accessible via
telnet or ssh, here's a start:

https://github.com/peak6/scala-ssh-shell

It's the same shell you get when you run "scala" with the same
features and limitations. The easiest way to access your live objects
is to register them on a global "object" singleton and import that.

As it ties directly into the compiler it only works for 2.9.1. Needs
sbt 0.7 to build.

Enjoy!
sRp

Ittay Dror 2
Joined: 2010-05-05,
User offline. Last seen 42 years 45 weeks ago.
Re: scala-ssh-shell
body p { margin-bottom: 0cm; margin-top: 0pt; }



srparish wrote:
5d3942d1-668d-456e-b411-1d469b48694a [at] k34g2000yqm [dot] googlegroups [dot] com" type="cite">
To those who've asked about having an embedded shell accessible via
telnet or ssh, here's a start:

https://github.com/peak6/scala-ssh-shell
Looks nice. How do I bind names to objects so that I can access them from within the shell?
5d3942d1-668d-456e-b411-1d469b48694a [at] k34g2000yqm [dot] googlegroups [dot] com" type="cite">

It's the same shell you get when you run "scala" with the same
features and limitations. The easiest way to access your live objects
is to register them on a global "object" singleton and import that.

As it ties directly into the compiler it only works for 2.9.1. Needs
sbt 0.7 to build.

Enjoy!
sRp
iron9light
Joined: 2009-07-04,
User offline. Last seen 3 years 15 weeks ago.
Re: scala-ssh-shell

Is it powershell-like ?Can we build a Powershell with scala?

srparish
Joined: 2011-10-09,
User offline. Last seen 42 years 45 weeks ago.
Re: scala-ssh-shell
Good question. I'd been using global "object" singletons that i could import, but that's not always a great solution. I've just added a patch that let's you specify a Seq of bindings, example:
    val sshd = new ScalaSshShell(port=4444, name="test", user="user",                                 passwd="fluke",                                 keysResourcePath=Some("/test.ssh.keys"),                                  IndexedSeq(                                   ("pi", "Double", 3.1415926),                                   ("nums", "IndexedSeq[Int]",                                     Vector(1,2,3,4,5))))
$ ssh -l user -p 4444 localhostuser@localhost's password: Connected to test, starting repl... Welcome to Scala version 2.9.1.r0-b20110831114755 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0).Type in expressions to have them evaluated.Type :help for more information.test> pi/2 res0: Double = 1.5707963test> nums sumres1: Int = 15

On Sun, Oct 9, 2011 at 3:01 AM, Ittay Dror <ittay [dot] dror [at] gmail [dot] com> wrote:



srparish wrote:
To those who've asked about having an embedded shell accessible via
telnet or ssh, here's a start:

https://github.com/peak6/scala-ssh-shell
Looks nice. How do I bind names to objects so that I can access them from within the shell?
It's the same shell you get when you run "scala" with the same
features and limitations. The easiest way to access your live objects
is to register them on a global "object" singleton and import that.

As it ties directly into the compiler it only works for 2.9.1. Needs
sbt 0.7 to build.

Enjoy!
sRp

srparish
Joined: 2011-10-09,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: scala-ssh-shell
By "shell" I mean "repl"; when i was googling to see if this already existed i was getting more results for "shell" then "repl" so i thought maybe the former word was better recognized by the community. Scala-ssh-shell allows you to embed the same shell you get when you run "scala" into any jvm so that you can ssh into the jvm and get a scala shell. This can be invaluable for debugging on the fly or testing out new functionality.
That said, scala would be an excellent choice of language to build powershell-like functionality into. With the ability to define operators, and the implicits, one should be able to make a pretty nice os shell.
sRp

On Sun, Oct 9, 2011 at 3:14 AM, IL <iron9light [at] gmail [dot] com> wrote:
Is it powershell-like ?Can we build a Powershell with scala?

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland