this post was submitted on 31 Oct 2023
2 points (75.0% liked)

Guix

316 readers
1 users here now

Guix is an advanced distribution of the GNU operating system developed by the GNU Project

founded 4 years ago
MODERATORS
2
(lemmy.ml)
submitted 1 year ago* (last edited 10 months ago) by [email protected] to c/[email protected]
 

Permanently Deleted

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 1 year ago

It appears that this is actually a Bash thing rather than a Guile thing:

https://superuser.com/questions/132489/hostname-environment-variable-on-linux

HOSTNAME is a variable that bash (but not other shells) sets by default. It is not exported.

Since it's not exported, it will not be inherited by env or any C program invoked from a bash shell.

For more information about why, see the comment in this other answer which mentions that HOSTNAME is not required for POSIX compliance:

https://superuser.com/questions/132489/hostname-environment-variable-on-linux/132500#132500

https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html

Curiously, I can reproduce this on my Guix System, but actually not on my Fedora system (where it is exported automatically), so I guess some distros choose to explicitly export the HOSTNAME variable?