Skip to content

Instantly share code, notes, and snippets.

@igemnace
igemnace / watchrun
Last active September 9, 2020 17:44
Watch file modifications with inotifywait and run arbitrary commands on those files
#!/usr/bin/env bash
# Depends on inotifywait, from inotify-tools
# Usage: watchrun dir... -- command...
# e.g. watchrun src -- ctags -a
dirs=()
until [[ $1 == -- ]]; do
dirs+=("$1")