For Windows, this seems to work OK (uses Oleg's "task"):

NB.* myIPAddress: return my own IP address (assumes Windows).
myIPAddress=: 3 : 0
  sess=. spawn 'ipconfig'
  sess=. dsp&.><;._1 LF,sess-.CR
  ipa=. >sess{~(sess{.~&.>#str) i. <str=. 'IP Address'
  ipa}.~2+ipa i: ':'
)


On 11/16/06, Joey K Tuttle <[EMAIL PROTECTED]> wrote:

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'

...
--
Devon McCormick
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to