【问题标题】:Communicating with the Erlang shell run with run_erl from shell scripts与运行在 shell 脚本中的 run_erl 的 Erlang shell 通信
【发布时间】:2011-04-20 10:52:21
【问题描述】:

我有一个通过run_erl 运行的 Erlang 应用程序。它创建文件erlang.pipe.1.werlang.pipe.1.r,我可以通过to_erl 启动控制台。到目前为止,一切都很好。然后我需要通过 shell 脚本与它交谈。显而易见的事情是

#!/bin/sh

EXPR=$1
PIPE_DIR=/tmp/mware
PIPE=$PIPE_DIR/erlang.pipe.1.w

echo $EXPR >> $PIPE

最初它有效,但现在我收到一个错误:

-sh: can't create erlang.pipe.1.w: Interrupted system call

ls 表明文件已经存在。出了什么问题,我该如何解决?

【问题讨论】:

    标签: erlang sh io-redirection run-erl


    【解决方案1】:

    您是否尝试过使用管道 (|) 而不是附加 (>>)。例如

    echo 'io:format("hello ~p", ["world"])' | to_erl $PIPE_DIR

    【讨论】:

      【解决方案2】:

      我对您当前使用的方法不是很熟悉,但我之前给出了three methods of connecting two nodes from the shell 的一些示例。也许在路上有些帮助。干杯!

      【讨论】:

        猜你喜欢
        • 2016-06-15
        • 2017-02-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-07-27
        • 2016-03-08
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多