Comment 10 for bug 1276796

Revision history for this message
Display Name (user340562791542-deactivatedaccount) wrote : Re: bash fails to provide FQDN for PS1 with \H

I confirm the problem. Bash uses gethostname which seems to be relying on the content of /etc/hostname. I have patched Bash to use a better API, getaddrinfo, the same used by the hostname utility when provided with the -f/--long option. Rodney, I could not find your report in the mailing list archives. I have subscribed to it and sent the report with patch attached and reference to this bug, but it is not showing up there still. It should appear here soon: http://lists.gnu.org/archive/html/bug-bash/2014-06/index.html.

In the case they don't feel like accepting it, I have created a Bazaar branch to handle this, it can be easily merged into the Ubuntu version. If we have a long hostname, then there's no sense in providing two placeholders for the same thing. This patch makes Bash more effectively differentiate between short and long hostname, by using a proper API to retrieve the value for the \H placeholder. This is enough reason for applying the change.