#!/bin/zsh (($+xtrace)) && (($xtrace)) && set -x awk -v RX="^${0:a:h}/" '$2 ~ RX {print $2}' /proc/mounts | sort -r | while IFS= read; do umount $REPLY || exit $? done