On Fri, 27 Apr 2001, Scott Alexander wrote:
> Should this work in a startup.pl file
>
> my $hostname = $ENV{"HOSTNAME"} ;
>
> from the prompt I can write echo $HOSTNAME and get the correct
> hostname of the server.
>
> But from within startup.pl I don't get it.
The reason "echo $HOSTNAME" works from the prompt is because /etc/profile
contains the command HOSTNAME=`/bin/hostname`. When you're in a
non-interactive environment, that's not available.
Try this:
my $hostname = `/bin/hostname`;
-Philip Mak ([EMAIL PROTECTED])