I am trying to have erlang run a small piece of code on a remote machine with a remote shell connection
erl $ERL_COOKIE -name ${SHELL_NAME} -remsh ${REMOTE_SHELL} -eval 'io:fwrite("~p",[registered()]), init:stop()'
The eval is not executed on the remote system, it's in some local bootstrap instead. I also tried -run
and -s
. Is there some way to do this from erl
?
If you look at the documentation of
init
and erl you will see that the expression for-eval
is evaluated byinit
in current erlang node and not by a shell. So using-remsh
to start a shell connected to another node does not affect where-eval
, or-run
and-s
, runs.