At 19:20  +0000 2006/11/16, Ronan Reilly wrote:
Hi All,

I'm running a distributed application on a cluster using J and I need a verb
that returns the IP (or hostname) of the node on which the jconsole is
running.
Thanks for any help.


Assuming you are in a _NIX environment, 2!:0 (Host) is
the key - e.g. I would use:

    host 'echo $HOSTNAME'
focus


where host is defined as:

   host
[: 2!:0 '('"_ , ] , ' || true)'"_


You might choose to make a simpler verb with just 2!:0
but the extra stuff in the above definition makes it
more useful in that it always returns a result, even if
the expression passed to the host has no result.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to