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
initand erl you will see that the expression for-evalis evaluated byinitin current erlang node and not by a shell. So using-remshto start a shell connected to another node does not affect where-eval, or-runand-s, runs.