How do you run escript with parameters?<br><br>[db@localhost scripts]$ ./rpc_test nonode@nohost erlang_test test<br>usage: You need to provide valid Node Name & Module Name & Args<br><br>[db@localhost scripts]$ ./rpc_test main nonode@nohost erlang_test test<br>
usage: You need to provide valid Node Name & Module Name & Args<br><br>Here is my escript called rpc_test:<br><br>#!/usr/bin/env escript<br>%% -*- erlang -*-<br>%-mode(compile).<br><br>-export([main/3, main/1, main/2]).<br>
%-export([main/3]).<br><br>main(Node,Module,Args) -><br> try<br> rpc:call(Node, Module, main, Args)<br> <br> catch<br> _:_ -><br> usage1()<br> end.<br><br>main(_) -><br> usage().<br>
<br>main(_,_) -><br> usage().<br> <br>usage() -><br> io:format("usage: You need to provide valid Node Name & Module Name & Args\n"),<br> halt(1).<br><br>usage1() -><br> io:format("usage1: RPC Call Problem\n"),<br>
halt(1).<br><br clear="all"><br>-- <br>rk<br><br>That which we persist in doing becomes easier for us to do; not that the nature of the thing itself is changed, but that our power to do is increased.<br>-Ralph Waldo Emerson