it is dltb
load'task'
load'strings'
myIPAddress=: 3 : 0
 sess=. spawn 'ipconfig'
 sess=. dltb&.><;._1 LF,sess-.CR
 ipa=. >sess{~(sess{.~&.>#str) i. <str=. 'IP Address'
 ipa}.~2+ipa i: ':'
)
  myIPAddress''
192.168.2.2


2006/11/18, Devon McCormick <[EMAIL PROTECTED]>:

Sorry - "dsp" is probably my own despacer: dsp=: 3 : 'y.-.'' '''
or something like this (I'm not on my own machine right now so I can't
check).
Alternately, it might just be a cover for a J standard function like
"dlt".

On 11/17/06, Tom Arneson <[EMAIL PROTECTED]> wrote:
>
> I was too fast, or didn't read your full message. After I loaded 'task'
it
> hangs up on dsp
>
>
>   load 'c:\j601\temp\2.ijs'
>    myIPAddress ''
> |value error: spawn
> |   sess=.    spawn'ipconfig'
>    load 'task'
>    myIPAddress ''
> |value error: dsp
> |   sess=.    dsp&.><;._1 LF,sess-.CR
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Devon McCormick
> Sent: Thursday, November 16, 2006 21:01
> To: Programming forum
> Subject: Re: [Jprogramming] Verb to return own IP number?
>
> 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
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



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




--
Björn Helgason, Verkfræðingur
Fugl&Fiskur ehf, Þerneyjarsund 23, Box 127
801 Grímsnes ,t-póst: [EMAIL PROTECTED]
Skype: gosiminn, gsm: +3546985532
Landslags og skrúðgarðagerð, gröfuþjónusta
http://groups.google.com/group/J-Programming


Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans

góður kennari getur stigið á tær án þess að glansinn fari af skónum
         /|_      .-----------------------------------.
        ,'  .\  /  | Með léttri lund verður        |
    ,--'    _,'   | Dagurinn í dag                     |
   /       /       | Enn betri en gærdagurinn  |
  (   -.  |        `-----------------------------------'
  |     ) |        (\_ _/)
 (`-.  '--.)       (='.'=)
  `. )----'        (")_(")
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to