> From: bill lam
> On Mon, 16 Nov 2009, Devon McCormick wrote:
> > whoami ''
> > +--------------+---------------+
> > |\\NY0193FF51XX|devon_mccormick|
> > +--------------+---------------+
> >
> > I can then use the machine name to customize the target name.
>
> Will that be over-skilled? 2!:5 'computername' and 'username' should
> return similar information. Also 1!:43'' should return the posix pwd.
Those solutions work well for Windows.
The nicest cross-platform method to finding a computer's hostname that I know
is:
CRLF -.~ shell 'hostname' [ require 'task'
Sockets work too:
> {: sdgethostname coinsert 'jsocket' [ load 'socket'
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm