erl_call -q

Bogdan Andu bog495@REDACTED
Wed Mar 30 12:40:11 CEST 2022


@Leo Liu

> erl -name t@REDACTED <http://erlang.org/mailman/listinfo/erlang-questions>
-noinput -eval "io:format(\"~p~n\", [rpc:call('somenode@REDACTED
<http://erlang.org/mailman/listinfo/erlang-questions>', math, sin, [1])]),
init:stop()"

Nice hack!

But weird behaviour of -eval. It seems to work only with io:format.
And what is this, undocumented, intimacy between -eval and io:format ?

Isn't suppose -eval to spit out the result of the evaluated block?

Why it needs io:format to do that?

-eval seems to spit out everything io:format throws at it.

io_lib:format/2 is totally ignored, for example.

Rhetorical questions anyway, here. I know -eval will not receive proper
love.

Anyway, it helps in my setup.

Thank you!
Bogdan

@erlang-questions mail list:
I didn't receive the mail from Leo Liu in my personal inbox to make a
proper reply!
Why is that happening?!?


On Tue, Mar 29, 2022 at 4:37 PM Bogdan Andu <bog495@REDACTED> wrote:

> But this defeats the purpose of NOT having a dedicated node to run a
> dedicated module
> to just stop nodes. Really? I was expecting this 'solution'.
> C'mon man, this is erlang we are talking about!
>
> It could do better than this!
>
>
>
>
> On Tue, Mar 29, 2022 at 4:27 PM Luke Bakken <luke@REDACTED> wrote:
>
>> At this point I would put together a small module, and use -s or -eval
>> to run the code. erlc is right there!
>>
>> On Tue, Mar 29, 2022 at 6:26 AM Bogdan Andu <bog495@REDACTED> wrote:
>> >
>> > I know erl -eval, but elixir --rpc-eval gives the error also, like this:
>> > --rpc-eval : RPC failed with reason :nodedown
>> > while erl -eval is silent about errors like node down which is very
>> important.
>> >
>> > May be a try catch would do the trick but already is too much to pass
>> to eval.
>> >
>> > On Tue, Mar 29, 2022 at 3:57 PM Luke Bakken <luke@REDACTED> wrote:
>> >>
>> >> Give "-eval" a try instead.
>> >>
>> >> On Tue, Mar 29, 2022 at 5:40 AM Bogdan Andu <bog495@REDACTED> wrote:
>> >> >
>> >> > Hi,
>> >> >
>> >> > I tried that before like this:
>> >> > $ erl -setcookie proxy -proto_dist inet_tls -ssl_dist_optfile
>> file_with_pem -name 'stop-node@REDACTED' -s rpc call target-node@REDACTED init
>> stop []
>> >> > Erlang/OTP 24 [erts-12.3] [source] [64-bit] [smp:4:4] [ds:4:4:10]
>> [async-threads:1]
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20220330/b662a576/attachment.htm>


More information about the erlang-questions mailing list