Permanently Deleted
You must log in or register to comment.
Try to export your variable before running your program:
$ export HOSTNAME
It is not because it is pre-defined, that it is exported. For instance, on my machine , both
PATH
andHOST
(notHOSTNAME
) are defined withbash
orzsh
, but onlyPATH
is exported.I have:
$ export | grep '^PATH' PATH=/opt/bin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin $ export | grep '^HOST' $
You can add the
export
directive in your shell “rc” file.