Throwing My Bash Functions / Aliases On Any Machine I SSH Onto


I am tired of always having to manually add my commonly used aliases on every machine I connect to, so I found a way to throw them on any machine I SSH onto. It will also remove them after I drop the connection.


gogo() {
  scp ~/.bashrc $1:/tmp/.bashrc_temp
  scp ~/.bash_profile $1:/tmp/.bash_profile_temp
  ssh -t $1 "bash --rcfile /tmp/.bashrc_temp /tmp/.bash_profile_temp ; rm /tmp/.bashrc_temp /tmp/.bash_profile_temp"


Leave a Comment

You must be logged in to post a comment.