On Tue, 17 Nov 2009, Sherlock Ric wrote:
> > From: bill lam
> > 
> > On Tue, 17 Nov 2009, Sherlock Ric wrote:
> > >
> > > The nicest cross-platform method to finding a computer's hostname
> > that I know is:
> > >
> > > CRLF -.~ shell 'hostname' [ require 'task'
> > 
> > In that case, I prefer 2!:5 IFUNIX{::'COMPUTERNAME';'HOSTNAME'
> > 
> 
> The trouble is that it doesn't work for me on Linux (Ubuntu)! Does my method 
> work on your flavour?

the hostname for debian (also likely ubuntu) is stored in the /etc/hostname
what will be the outout of
 cat /etc/hostname 

if there is no such file or its content is empty, try
 sudo -e /etc/hostname

and write the hostname of your choice.  

Your method need to shell an external program to do what can be done
by J native command.  over-skilled ;-)

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to