error handling for ssh-host function

This commit is contained in:
gurkenhabicht 2026-02-09 15:27:53 +01:00
parent 401157258e
commit 1446cc9948
1 changed files with 6 additions and 2 deletions

View File

@ -11,8 +11,12 @@ ssh() {
# Use fzf to find all your configured ssh connection
ssh-host() {
if [ "$(which fzf 2>/dev/null)" ]; then
ssh $(cat "$HOME/.ssh/config" "$HOME/.ssh/conf.d/individual_user" \
| awk '$1 == "Host" && $2 != "*" {print $2}' | fzf --reverse)
else
echo "fzf not installed!"
fi
}
# Creates a new directory and immediately changes into it