Last active
September 9, 2024 00:16
-
-
Save kristopolous/cac9c44db46d618caeb42b4114d39ed0 to your computer and use it in GitHub Desktop.
ssh slash enable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh() { | |
local _ssh="/usr/bin/ssh" | |
local n="" | |
[[ "$*" =~ \/ ]] || { $_ssh $*; return } | |
echo "$*" | tr "/" " " | rev | while read -d' ' i; do | |
i=$(echo "$i" | rev) | |
[[ -n "$n" ]] && n="\"$n"\" | |
n="$_ssh $i $n" | |
done | |
i=$(echo "$i" | rev) | |
eval "$_ssh -t $i $n" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment