
-module(bug).

-export([main/0]).

main()->
    [_,MyHost] = string:tokens(atom_to_list(node()),"@"),
    global:register_name(glob,self()),
    {ok, Node} = slave:start(MyHost,bar,"-setcookie sesame"),
    io:format("node ~s started~n",[Node]),
    Res = net_adm:ping(Node),
    io:format("ping: ~s~n",[Res]),
    Res2 = rpc:call(Node,global, registered_names, []),
    io:format("registered: ~p~n",[Res2]).
                

    
    
    
