|
|
|
Create on-the-fly hostname lists for ssh tab completion
The macports suggestion is a good one, but IMO, includes too much. If you don't have macports installed, you can add the following to your .bash_profile (I wouldn't add it to my .bashrc, since that gets read in by cron jobs and remote commands).
There are a couple improvements here. First, this will also read in aliases in your ~/.ssh/config file. Secondly, it will ignore commented out entries in your ~/.ssh/known_hosts file. Finally, this is a function and not a static list. Thus, it is immediately aware of any new additions to either file (although on really slow machines it will be slower than a static list).
---
Create on-the-fly hostname lists for ssh tab completion
Nice job, Nem! I don't actually have a ~/.ssh/config file, so here's a modification to deal with that situation:
Create on-the-fly hostname lists for ssh tab completion
Thanks for the slick inclusion of .ssh/config. However, I had to make a quick tweak to 'awk' out the 3rd entry rather than the 2nd.
awk '{print $3}' My .ssh/config uses this syntax, which may or may not be 'standard', but definitely works. My config syntax comes from ssh v. 1, so the current accepted syntax could be VASTLY different. Host = solutions
Create on-the-fly hostname lists for ssh tab completion
tcsh and/or zsh versions? I actually would find the aliases in config more useful than known_hosts I think? My user name is rarely the same on the box I'm logging into.
--- Mark Moorcroft ELORET Corp. - NASA/Ames RC Sys. Admin. |
SearchFrom our Sponsor...What's New:HintsNo new hintsComments last 2 days
Links last 2 weeksNo recent new linksWhat's New in the Forums?
The Editor's Corner...Here are some of my (robg) other projects...
Hints by TopicNews from Macworld
The macosxhints PollWhat version of OS X are you running as your main OS?
Other polls | 11,476 votes | 42 comments
|
|
Copyright © 2009 Mac Publishing LLC (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Powered by Geeklog Created this page in 0.03 seconds |
|