Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,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 whoever 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 Mar 24, '08 09:24:27AM

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 Mar 24, '08 03:45:22PM

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 | # ]