Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Better still...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Better still...
Authored by: serversurfer on Nov 28, '01 12:53:47AM
If you list your servers as machines in NetInfo, (which is where we do that sort of thing in X) then you can just change your /usr/share/init/tcsh/completions file to read:
# Override this with something smarter if you wish
alias list_all_hostnames 'nidump hosts .'

This prevents you from having to to edit a hosts file. (BTW, /etc/hosts would have worked just fine. The "smarter" thing to do is use nidump.) Also, any changes made to NetInfo (THE place to be in 2001!) are automatically incorporated in to your ssh completions.
The reason you want to avoid using /etc/hosts (which is where most *NIX systems define server aliases) Is because OSX uses NetInfo to keep track of that sort of thing (it's more network friendly) and does not read /etc/hosts by default. nidump reads the NetInfo server aliases and dumps them in the same format as /etc/hosts, so we can use it to define our server completions.
Post if you need help defining new machines in NetInfo Manager, but basically, they will look like the 'localhost' entry, minus the 'serves' parameter (which I think is used to ID NetInfo domains).

[ Reply to This | # ]