Created
November 29, 2018 19:57
-
-
Save balbuf/abc94fffb70bc07173af621a5673c621 to your computer and use it in GitHub Desktop.
SSH with local aliases applied
This file contains 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
# establish an ssh session with the given args and apply all of your local bash aliases | |
# use just like you would ssh to login to a remote shell, e.g. `ssha user@host` | |
function ssha() { | |
ssh -t "$@" 'bash --init-file <(echo '"$(printf %q "$(alias)")"')' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment