This would imply that the difference between \h and \H is
\h is only the hostname
\H is the FQDN
The source code however shows:
case 'h':
case 'H':
temp = savestring (current_host_name);
if (c == 'h' && (t = (char *)strchr (temp, '.')))
*t = '\0';
goto add_string;
This shows that \h is always the short form of the hostname while \H may be the FQDN. In most cases, however, \H just resolves so the short form hostname and not the FQDN (aka domain name).
This is an ambiguity in the bash man page documentation. The bash man page should be updated to say:
\h
The hostname, up to the first ‘.’.
\H
The hostname possibly with the parts after the '.' (domain name or FQDN but usually not)
Rebooted. No change to hostname. No DHCP. Problem still exists.
Should see a prompt of: :/home/ rbeede] $
[<email address hidden>
but instead I only get: okdev1381: /home/rbeede] $
[rbeede@
[rbeede@ okdev1383: /home/rbeede] $ echo $PS1 /home/rbeede] $
[\u@\H:
[rbeede@ okdev1383: /home/rbeede] $ cat /etc/os-release
NAME="Ubuntu"
VERSION="13.10, Saucy Salamander"
The bash man page states:
\h
The hostname, up to the first ‘.’.
\H
The hostname.
This would imply that the difference between \h and \H is
\h is only the hostname
\H is the FQDN
The source code however shows:
case 'h': host_name) ;
case 'H':
temp = savestring (current_
if (c == 'h' && (t = (char *)strchr (temp, '.')))
*t = '\0';
goto add_string;
This shows that \h is always the short form of the hostname while \H may be the FQDN. In most cases, however, \H just resolves so the short form hostname and not the FQDN (aka domain name).
This is an ambiguity in the bash man page documentation. The bash man page should be updated to say:
\h
The hostname, up to the first ‘.’.
\H
The hostname possibly with the parts after the '.' (domain name or FQDN but usually not)