-
Notifications
You must be signed in to change notification settings - Fork 427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: fix init-hook script for hostname matching #1182
Conversation
Hi @michaelhaaf But I think the correct one would be
Tested and it works |
The following are equivalent and all work:
Maybe there's room for preference; personally the first choice makes the most sense to me, the rest have superfluous commands. (to elaborate: The call to |
The The |
The init-hook provided for creating a distrobox with the the same hostname as its host has two typos: - Command substitution wrapping `uname -n` suppressing stdout redirect - trailing "`" Using this init-hook as suggested causes build errors. This fix corrects the suggested script by echoing the command substitution and removing the trailing "`". See issue 89luca89#1164 for details.
It's unclear to me how that works (in my tests I got the same result using both). But, in the interest of getting a working version in the documentation/removing the typo/moving on, I've updated my PR to use |
Thanks a lot @michaelhaaf |
Adding a little bit to this conversation as there was a typo in this change. Having the single quotation marks outside of the double quotation marks will prevent Changing Other than that, the command as the first example requires a reboot for the |
The init-hook provided in the useful tips documentations for creating a distrobox with the the same hostname as its host has two typos:
uname -n
suppressing stdout redirectUsing this init-hook as suggested causes build errors (see #1164). This fix corrects the suggested script by removing the command substitution and the trailing "`".
To elaborate: I think command substitution here is misplaced since
uname -n
already prints to stdout and can be redirected directly. Or you can useecho
on the provided command substitution. Or you can use thehostname
command. I.e.uname -n > /etc/hostname
echo "$(uname -n)" > /etc/hostname
hostname "$(uname -n)"
Tested on Fedora 39 below: