Skip to content

Instantly share code, notes, and snippets.

@adamdoupe

adamdoupe/sshere

Forked from anonymous/sshere
Created Aug 13, 2013
Embed
What would you like to do?
function sshere {
CURRENT=$(pwd)
[[ "$CURRENT" =~ ^"$HOME"(/|$) ]] && CURRENT="~${CURRENT#$HOME}"
ssh -t $@ "if [ -d $CURRENT ]; then cd $CURRENT; fi; exec \$SHELL"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment