My bash prompt shows my hostname. If I change my hostname with the
hostname command, in
$HOSTNAME, the prompt still uses the old name. Is it possible to update this without logging out?
If you have
If you want your bash prompt to update dynamically as the hostname (as reported by the
It's wasteful (runs a subshell every time you hit return -- not horrible but inelegant,) so I would only use this where the situation requires it. I use it when working on a base VM template that is used to generate multiple target VM instances where metadata about the instance is indicated in the hostname. And even then the custom