Thanks for the hints. And while I'm at it, thanks for all your work on the project and forum!
Shuffling the sequence so "host=" isn't the first code does indeed avoid the problem.
The host name in Linux reminds me of the brain surgery scene at the beginning of Buckaroo Banzai where Buckaroo advises the other doctor: "Don't tug on that! You never know what it might be attached to."
In this case, "sudo hostname foo" will update the host name. Unfortunately it also confuses the X server(?) so that the menu system becomes unresponsive. (Right click on the desktop, for example, and the "logout" app won't launch.)
So, the second step to manually updating the hostname is to hit <clt>+<alt>+<bksp> to kill X and then "startx" at the resulting command line. After that, everything seems to be operating normally with the new host name.
Thanks again,
Tyler