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