Skip to content

Instantly share code, notes, and snippets.

@adamdoupe
adamdoupe / sshere
Created August 13, 2013 19:39 — forked from anonymous/sshere
function sshere {
CURRENT=$(pwd)
[[ "$CURRENT" =~ ^"$HOME"(/|$) ]] && CURRENT="~${CURRENT#$HOME}"
ssh -t $@ "if [ -d $CURRENT ]; then cd $CURRENT; fi; exec \$SHELL"
}