#!/usr/bin/bash echo "before nspawn; before read" read echo "before nspawn; after read" systemd-nspawn -D "/path/to/chroot" echo FOOBAR echo "after nspawn; before read" read echo "THIS WON'T BE REACHED"