# create new directory and cd in single command function mkdircd () { mkdir -p “$@” && eval cd “\”\$$#\””; } # ssh to remote host and go to directory function sshcd () { ssh username@”$@” -t “cd /path/dir1/dir2/ ; \$SHELL -l”; } ALL_HOSTS=”hostname1 hostname2 hostname3″ for AHOST in $ALL_HOSTS do alias ssh2″$AHOST”=”sshcd $AHOST ” …