Skip to content

Instantly share code, notes, and snippets.

@jonahbron
Last active January 18, 2023 19:48
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jonahbron/5549848 to your computer and use it in GitHub Desktop.
Save jonahbron/5549848 to your computer and use it in GitHub Desktop.
Wrapper for ssh that allows you to automatically source your own .bashrc when logging-in to another computer. Place in your .bashrc file to use.
# Wrapper for ssh to automatically source bash config file on remote machine.
# Sources ~/.bashrc_remote
#
# author Jonah Dahlquist
# license CC0
sshs() {
ssh ${*:1} "cat > /tmp/.bashrc_temp" < ~/.bashrc_remote
ssh -t ${*:1} "bash --rcfile /tmp/.bashrc_temp ; rm /tmp/.bashrc_temp"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment