#!/bin/bash set -euo pipefail ROOT="${1:-$PWD}" echo "🔩 Fixing shebangs & +x under $ROOT ..." find "$ROOT" -type f -name "*.sh" -print0 | while IFS= read -r -d '' f; do if ! head -1 "$f" | grep -q "#!"; then (printf "#!/bin/bash\n"; cat "$f") > "$f.tmp" && mv "$f.tmp" "$f" fi chmod +x "$f" || true done echo "✅ Permissions & shebangs normalized."