[erlang-questions] [Erlang-Q] What does Ctrl+G do for the Eshell?

Steven Yu <>
Tue Oct 4 00:22:53 CEST 2011


Hi,

Not sure if its fixed in R14 but why when running <r> without specifying
node in user switch command your local erlang crashes? e.g.

User switch command
 --> r
{error_logger,{{2011,10,4},{0,18,25}},supervisor_report,[{supervisor,{<0.26.0>,user_sup}},{errorContext,child_terminated},{reason,{noproc,{gen_server,call,[{global,pool_master},get_node]}}},{offender,[{pid,<0.28.0>},{mod,user_sup}]}]}......

Can this behaviour be changed?

Regards,




On Tue, Oct 4, 2011 at 12:13 AM, Anders Ramsell
<>wrote:

> Barco You wrote:
>
>> Hello Erlangers,
>>
>> When starting a erl shell, we will see a printout as:
>> Eshell V5.8.4  (abort with ^G)
>>
>>
>> then, I tried to press Ctrl+G and got:
>> User switch command
>>  -->  ls
>> Unknown command
>>  -->  q().
>> Unknown command
>>  -->
>>
>> I can do nothing with the prompt "-->". How to quit from it? and
>> what's "Ctrl+G" used for?
>>
>>
>>
> The words "abort with ^G" are in fact hiding an extremely useful
> function called JCL (job control mode) [1]. I overlooked this
> function for years.  Now I use it on a near daily basis and just
> love it.
>
> [1] http://www.erlang.org/doc/man/**shell.html<http://www.erlang.org/doc/man/shell.html>
>
> Assume you have an Erlang node named '' running as a
> service/daemon on your system. Wouldn't it be great if you could
> run interactive commands on this node just like you do in a
> shell? JCL let's you do that with ease.
>
> Start up a new shell '' and hit ctrl-G to enter JCL.
> Now start a remote shell to ''.
>
> | ()1>
> | User switch command
> |  --> r 
> |  --> j
> |    1* {shell,start,[init]}
> |    2  {,shell,start,[]}
>
> You now have a local shell with id=1 and a remote shell with
> id=2. Connect to the remote shell:
>
> |  --> c 2
> |
> | ()1>
>
> Now you have a shell on the server node where you can run any
> command you want. This means you can call any exported function
> in all modules loaded on the server. That kind of interaction
> with a running system can be invaluable when trying to figure out
> why it doesn't behave quite the way you planned.
>
> Now of course there is a backside to the story. Doing something
> wrong may cause your system to crash. So hey - let's be careful
> out there.
>
> /Anders
>
>
> ______________________________**_________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/**listinfo/erlang-questions<http://erlang.org/mailman/listinfo/erlang-questions>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111004/f44ba482/attachment.html>


More information about the erlang-questions mailing list