From 5e6a6652651de8918d0176ae587af3c5e19754e1 Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 30 Nov 2026 17:16:37 +0100 Subject: [PATCH] simplify --- scripts/exec-watch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/exec-watch b/scripts/exec-watch index 89eea75..0e72bd1 100755 --- a/scripts/exec-watch +++ b/scripts/exec-watch @@ -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