From 0485edf19708a5afb82cb637d4fa40934e251400 Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Sat, 21 Oct 2023 16:52:37 +0200 Subject: [PATCH] Add 'fzf-ssh' script --- .bin/fzf-ssh | 3 +++ .bin/ssh-hosts | 5 +++++ 2 files changed, 8 insertions(+) create mode 100755 .bin/fzf-ssh create mode 100755 .bin/ssh-hosts diff --git a/.bin/fzf-ssh b/.bin/fzf-ssh new file mode 100755 index 0000000..0253c64 --- /dev/null +++ b/.bin/fzf-ssh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +ssh "$(ssh-hosts | fzf)" diff --git a/.bin/ssh-hosts b/.bin/ssh-hosts new file mode 100755 index 0000000..c6e6547 --- /dev/null +++ b/.bin/ssh-hosts @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +ssh_hosts=$(grep -E 'Host [a-z0-9\-]*$' ~/.ssh/config | awk '{print $2}') + +echo "$ssh_hosts"