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


Click here to return to the 'Use hostname completion in Bash' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use hostname completion in Bash
Authored by: Titanium Man on Jan 30, '04 10:11:05AM
This code allows you to use hostname completion from NetInfo (bash has built-in hostname completion from /etc/hosts, but that's not really useful on Mac OS X)
Add an entry to /etc/hosts for your computer's current IP address and a unique hostname (i.e. foobar.foo), then ping foobar.foo. You ping yourself. If you happen to be using zsh, open a new Terminal window and typ 'ssh f' then hit the TAB key. It autocompletes to foobar. Add machines records to NetInfo if you want, but for what you're trying to do, /etc/hosts should work.

[ Reply to This | # ]