Bug 7028

Summary: HOSTNAME environment variable not set
Product: Busybox Reporter: Benjamin Shadwick <benshadwick>
Component: NetworkingAssignee: unassigned
Status: RESOLVED FIXED    
Severity: enhancement CC: busybox-cvs
Priority: P5    
Version: 1.21.x   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
Host: Target:
Build:

Description Benjamin Shadwick 2014-04-13 05:23:54 UTC
Background:
- Running BusyBox v1.21.1 as part of a firmware load on a mips-based Asus router/gateway.
- This build appears to include ash and uname applets but not hostname.
- I am an end-user of the firmware and not its developer/maintainer.

It appears that the ash prompt and uname -n command are both able to determine what the hostname of the system is, but there is no environment variable (e.g. HOSTNAME or HOST) set by default for shell scripts to use.

My understanding is that other shells typically set one of these automatically as a built-in feature; it would be useful if HOSTNAME (or HOST) were set by default by busybox's ash as well.
Comment 1 Denys Vlasenko 2014-04-15 09:44:21 UTC
Fixed in git:

commit 3fa97af7ccc75264fb237f279f253eddf0ba4da1
Author: Denys Vlasenko <vda.linux@googlemail.com>
Date:   Tue Apr 15 11:43:29 2014 +0200

    ash,hush: set $HOSTNAME is bash compat