Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!


Click here to return to the 'Create on-the-fly hostname lists for ssh tab completion' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Create on-the-fly hostname lists for ssh tab completion
Authored by: thegooch49 on Mon, Mar 24 2008 at 9:24AM PDT
Any way to make this work with tcsh? I tried this in my .tcshrc, and I got an error of an 'illeagal variable'.

[ Reply to This | # ]
Create on-the-fly hostname lists for ssh tab completion (TCSH)
Authored by: joab on Mon, Mar 24 2008 at 3:45PM PDT
Enter this into your .tcshrc:

set hosts = `sed -e 's/^ *//' -e '/^#/d' -e 's/[, ].*//' -e '/\[/d' ~/.ssh/known_hosts | sort -u`
complete ssh 'p/1/$hosts/' 'p/2/c'

It completes first hosts and then commands.

[ Reply to This | # ]