Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Erlang shell from a browser?

I have an erlang app with a web frontend. Right now, if you want to talk to it via the shell, you have to do it from the command line. This app will be running on multiple platforms and in environments where the administrator may not be very command-line savvy, but for tech support purposes I'd like to be able to have them bring up a shell in their browser and be able to inspect the state of the node from that.

Has someone already implemented such a thing? It would need to support Windows, Red Hat, and OS X, as well as major browsers. Something that looked a lot like the shell and supported the same commands would be best.

like image 393
Sean Lynch Avatar asked Feb 27 '10 01:02

Sean Lynch


People also ask

How do I get to Erlang shell?

On a Unix system you enter the command erl at the operating system prompt. This command starts the Erlang runtime system and the Erlang shell. On the Windows platform you normally start Erlang/OTP from the start menu. You can also enter the command erl or werl from a DOS box or Command box.

How do you define a record in Erlang shell?

If you want to experiment with records at the command line, you'll have to use a shell command. Let's try that in the erlang shell tool, erl . And then you can declare a record the same way you would in Erlang. And to inspect that variable in erl, just declare the variable and put a .

Which function is used to exit the Erlang shell?

JCL mode Once there you can use the command q to quit the Erlang shell. This is similar in effect to erlang:halt(0).

Which of the following is the correct syntax to define a function in the Erlang shell?

Syntax − f(x). Where, x – is the variable for which the binding needs to be removed. For example − Following is an example of how the function is used. First a variable called Str and Str1 are defined.


2 Answers

A possibility could be to use a web based terminal such as AjaxTerm and to set the Erlang shell as the default shell for the web user. For example, in a UNIX system, this could be done by setting the proper value in the /etc/passwd file.

Obviously, we're considering here a secure environment, in which access is not provided to any malicious user and the nodes are not accessible from the outside world.

like image 135
Roberto Aloi Avatar answered Oct 02 '22 07:10

Roberto Aloi


I've just run into the erlwsh project. Does exactly what you need.

like image 44
Zed Avatar answered Oct 02 '22 07:10

Zed