public
Last active

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
*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!!!!!

I would have expected node@127.0.0.1 on lines #15, #20 and #21

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.