<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Times New Roman; font-size: 12pt; color: #000000'>Hi,<br><br>It was created back in the days when we were thinking of Erlang as more of an OS where you could run multiple "jobs" at the same time. Apart allowing you to start many concurrent jobs, not just the shell, it also multiplexes the i/o so only the connected job (the 'c' command) gets access, both read and write, to the user terminal. I/o to the other jobs is blocked. Otherwise having mixed i/o to/from many jobs at the same time becomes a right mess.<br><br>The ^G works as all user terminal input passes through this layer. Now it should maybe be rewritten to use separate windows instead? If we ever get a "standard" window interface. :-)<br><br>The name JCL (Job Control Language) is a joke on IBM's JCL which they used back in the old days to control their batch jobs. It was if course completely different.<br><br>Robert<br><br><hr id="zwchr"><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><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" target="_blank">anders@theheartofgold.org</a>> wrote:<br>> 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" target="_blank">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" target="_blank">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br></div>
<br>_______________________________________________<br>erlang-questions mailing list<br>erlang-questions@erlang.org<br>http://erlang.org/mailman/listinfo/erlang-questions<br></blockquote><br></div></body></html>