Path: csiph.com!fu-berlin.de!usenet.stanford.edu!not-for-mail From: Greg Wooledge Newsgroups: gnu.bash.bug Subject: Re: [PATCH] Fix \H: Use getaddrinfo to get full hostname Date: Wed, 24 Jul 2019 10:46:29 -0400 Lines: 23 Approved: bug-bash@gnu.org Message-ID: References: <20190724135835.110473-1-whissi@gentoo.org> <454afb04-c18a-1b82-d869-34539c194b3d@case.edu> <20190724144629.GL1218@eeg.ccf.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: usenet.stanford.edu 1563979594 32679 209.51.188.17 (24 Jul 2019 14:46:34 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash@gnu.org To: Thomas Deutschmann Envelope-to: bug-bash@gnu.org Mail-Followup-To: Thomas Deutschmann , bug-bash@gnu.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 139.137.100.1 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <20190724144629.GL1218@eeg.ccf.org> X-Mailman-Original-References: <20190724135835.110473-1-whissi@gentoo.org> <454afb04-c18a-1b82-d869-34539c194b3d@case.edu> Xref: csiph.com gnu.bash.bug:15228 On Wed, Jul 24, 2019 at 04:38:06PM +0200, Thomas Deutschmann wrote: > Can you tell me more about your system and how you (your administrator) > set up your system so that hostname will return FQDN? It's common outside the Linux world. # hostname minea.eeg.ccf.org # uname -a HP-UX minea B.11.11 U 9000/785 4239047153 unlimited-user license > I hope you are not talking about putting FQDN into a file which is > expecting hostname only... Yes, many people do precisely that. They configure their systems so the "hostname" command returns an FQDN, as I showed above. (Not my design, not my choice.) This is what bash's \H vs. \h is for. If your system's hostname has dots in it, \h shows only the part up to the first dot (because that's usually what you want in your prompt -- the shorter version), and \H is available just in case you actually want the full version.