#!/bin/bash TTY_TMP=$(mktemp) $(socat -d -d ~/Library/Containers/com.docker.docker/Data/debug-shell.sock pty,rawer 2>&1 | grep -Eo --line-buffered "/dev/tty\w+" > ${TTY_TMP} ) & sleep 2 TTY=$(tail -n 1 "${TTY_TMP}") picocom $TTY 2>/dev/null