Last active
December 16, 2015 06:09
-
-
Save joedevivo/5389301 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*Window A* | |
➜ ~ erl -name node@127.0.0.1 -setcookie joe | |
*Window B* | |
# 1, try starting erl with -remsh via open_port | |
➜ ~ erl | |
Erlang R15B03 (erts-5.9.3.1) [source] [64-bit] [smp:4:4] [async-threads:0] [kernel-poll:false] | |
Eshell V5.9.3.1 (abort with ^G) | |
1> P = open_port({spawn, "erl -name local@127.0.0.1 -hidden -remsh node@127.0.0.1 -setcookie joe"}, | |
1> [stream, use_stdio, exit_status, binary, stderr_to_stdout]). | |
#Port<0.517> | |
2> flush(). | |
Shell got {#Port<0.517>,{data,<<"Eshell V5.9.3.1 (abort with ^G)\n">>}} | |
Shell got {#Port<0.517>,{data,<<"(local@127.0.0.1)1> ">>}} | |
ok | |
3> port_command(P, "node().\n"). | |
true | |
4> flush(). | |
Shell got {#Port<0.517>,{data,<<"'local@127.0.0.1'\n">>}} | |
Shell got {#Port<0.517>,{data,<<"(local@127.0.0.1)2> ">>}} | |
ok | |
5> q(). | |
ok | |
# 2, run the same command we ran with open_port from the command line | |
➜ ~ erl -name local@127.0.0.1 -hidden -remsh node@127.0.0.1 -setcookie joe | |
Erlang R15B03 (erts-5.9.3.1) [source] [64-bit] [smp:4:4] [async-threads:0] [kernel-poll:false] | |
Eshell V5.9.3.1 (abort with ^G) | |
(node@127.0.0.1)1> node(). | |
'node@127.0.0.1' | |
(node@127.0.0.1)2> q(). | |
ok | |
(node@127.0.0.1)3> | |
User switch command | |
--> q | |
THE NODE NAMES ARE DIFFERENT!!!!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would have expected
node@127.0.0.1
on lines #15, #20 and #21