17 lines
249 B
Plaintext
17 lines
249 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
|
||
|
if [[ "$1" == "" || "$2" == "" ]]; then
|
||
|
echo "usage: ${0##*/} <file> <command>";
|
||
|
exit 2;
|
||
|
fi
|
||
|
|
||
|
set -euo pipefail
|
||
|
|
||
|
while true; do
|
||
|
inotifywait \
|
||
|
--event modify \
|
||
|
--event move_self \
|
||
|
--recursive \
|
||
|
$1 && $2
|
||
|
done
|