sshopener (571B)
1 #!/bin/sh 2 3 set -x 4 5 if [ $# -lt 1 ]; 6 then 7 printf "usage: %s URI\n" "$(basename "$0")" >&2 8 exit 1 9 fi 10 11 uri="$1" 12 13 # »cut, cut, cut, ...« makes the chicken. 14 host="$(printf "%s\n" "$uri" \ 15 | cut -d ':' -f 2- \ 16 | cut -c 3- \ 17 | cut -d':' -f 1 \ 18 | cut -d'/' -f 1)" 19 20 # »cut, cut, cut, ...« makes the turkey. 21 port="$(printf "%s\n" "$uri" \ 22 | cut -d ':' -f 2- \ 23 | cut -c 3- \ 24 | cut -s -d':' -f 2- \ 25 | cut -d '/' -f 1)" 26 [ -z "$port" ] && port="22" 27 28 $XTERM -e sh -c \ 29 "printf \"URI: %s\n\" "${uri}"; \ 30 ssh -p \"${port}\" \"${host}\"; \ 31 read;" \ 32 2>&1 >/dev/null & 33