#!/bin/sh for mach in machines/*; do statedir="state/${mach##*/}" rm -rvf "$statedir" done