#!/bin/sh # First try to connect to an existing session. If that fails use the # normal command to make a new one. I don't know the right # incantation to make screen do this in a single command. # screen -e ^Z^Z -x || exec screen -e ^Z^Z -D -R