use read stdin technique to determine HUP on remote exec