Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
fishにて、pecoを使って~/.ssh/configの情報を元にsshの接続先を選択可能にしたやつ
function peco_ssh
awk '
tolower($1)=="host" {
for(i=2;i<=NF; i++) {
if ($i !~ "[*?]") {
print $i
}
}
}
' ~/.ssh/config | sort | peco | read -l hostname
if test -n "$hostname"
ssh $hostname
end
end
alias s "peco_ssh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.