#!/bin/zsh # Open a terminal on a remote system and run a command there inside the regular # shell. function ssh_run () { system=$1 if [ "x$2" = "x" ]; then ssh -t $system else ssh -t $system \$SHELL -ic \"$@[2,$#-1]\" fi } ssh_run $@