#!/bin/sh while true; do go build main.go ./main & PID=$! inotifywait --exclude 'attachments|main|/\..+' -r -e modify . kill $PIDdone