Skip to content

Instantly share code, notes, and snippets.

View m42e's full-sized avatar

Matthias Bilger m42e

View GitHub Profile
@m42e
m42e / fzf-ssh.zsh
Last active June 2, 2019 06:35 — forked from dohq/fzf-ssh.zsh
fzf-ssh
function _resolv_ssh_hosts () {
local CURRENTFILE
eval CURRENTFILE=$1
local selectedhosts=$(grep "Host " ${CURRENTFILE} | grep -v '*' | cut -b 6-)
local includes=$(grep "Include " ${CURRENTFILE} | cut -b 9-)
for inc in ${(@f)includes}; do
selectedhosts+=$(_resolv_ssh_hosts $inc)
done
echo $selectedhosts
}