Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jul 2004 01:33:41 -0500
From:      Miguel Cardenas <mfcardenas@prodigy.net.mx>
To:        freebsd-questions@freebsd.org
Subject:   getenv() fails
Message-ID:  <200407130133.41534.mfcardenas@prodigy.net.mx>

next in thread | raw e-mail | index | archive | help
Hello...

I have a problem getting the hostname from the HOSTNAME var...

#include <stdlib.h>
...
char* host = getenv("HOSTNAME");

returns always NULL... why? if I do 'echo $HOSTNAME' it is visible, but inside 
my C program returns NULL... what is wrong? is it a bug?

Thanx...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200407130133.41534.mfcardenas>