#!/bin/sh sigint_handler() { kill $PID exit } trap sigint_handler SIGINT while true; do cargo run & PID=$! inotifywait -e modify -e move -e create -e delete -e attrib -r src/ templates/ content/ kill $PID done