[ejabberd] shell behavior of tty vs stdin

Brian Acton acton at whatsapp.com
Mon Jan 11 11:32:43 MSK 2010


Hi guys,

I recently tried to write a short script to query the database and get some
info. For the sake of shortness, let's say that this script was simply:

mnesia:info().
halt().

Let's say that I saved this script as info.erl.

Now, the weird thing is that if I cut/paste the above two lines into the
shell via ejabberdctl debug, i get one behaviour. If I run the command like
this:

ejabberdctl debug < info.erl

I get a different behavior.

In the former, i get somewhat expected behaviour as I get the mnesia info.
However, in the latter, I get basically nothing and the node is identified
as a debug node. It is as though the remote connection has not been
instantiated yet.

Is this normal? I would have expected the two behaviors to be identical.
Unfortunately, they were not. Lastly, I tried using expect to simulate a tty
and that failed miserably.

Can anyone explain?

And yes, I know that this is not the erlang way of doing things. Presumably,
I should write my code as an erl module and compile it in. I was in a hurry
and was hoping to get something quick up and going....

Any tips or info definitely appreciated.

Thx,

--b
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20100111/45d35e62/attachment.html>


More information about the ejabberd mailing list