simplify
This commit is contained in:
+4
-4
@@ -1,10 +1,10 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
script_name=${0##*/}
|
||||
script_name=$(basename "$0")
|
||||
|
||||
if (( $# == 0 )); then
|
||||
if [ "$#" -eq 0 ]; then
|
||||
echo "Usage: $script_name command [args ...]" >&2
|
||||
exit 2
|
||||
fi
|
||||
@@ -15,6 +15,6 @@ if ! command -v inotifywait >/dev/null; then
|
||||
fi
|
||||
|
||||
while true; do
|
||||
("$@") || echo "$script_name: command exited with status $?" >&2
|
||||
( "$@" ) || echo "$script_name: command exited with status $?" >&2
|
||||
inotifywait --quiet --recursive --event close_write,move,create,delete . >/dev/null
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user