From cbcb6e0410f5cdc4c9af4b20a748f072ca060fdb Mon Sep 17 00:00:00 2001 From: Thomas Dannenberg Date: Thu, 28 Aug 2025 17:54:36 +0000 Subject: [PATCH] Kapitel 13/Tutorial.md aktualisiert --- Kapitel 13/Tutorial.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Kapitel 13/Tutorial.md b/Kapitel 13/Tutorial.md index 668049f..ca65cc2 100644 --- a/Kapitel 13/Tutorial.md +++ b/Kapitel 13/Tutorial.md @@ -363,7 +363,8 @@ Im Ergebnis findest du im Feld `data[0].id` deine **User-ID** (z. B. `123456789` **Command (als Expression):** ```js - {{"set -euo pipefail; STATE_FILE=\"/srv/clipper/state/vod_seen.list\"; fe=false; ne=false; arr='[]'; if [ -f \"$STATE_FILE\" ]; then fe=true; if [ -s \"$STATE_FILE\" ]; then ne=true; mapfile -t L < \"$STATE_FILE\"; json='['; sep=''; for id in \"${L[@]}\"; do id_trim=\"${id//[$'\\t\\r\\n ']}\"; [ -n \"$id_trim\" ] || continue; json+=\"$sep\\\"$id_trim\\\"\"; sep=','; done; json+=']'; arr=\"$json\"; fi; fi; printf '{\\"file_exists\\":%s,\\"non_empty\\":%s,\\"vods\\":%s}\\n' \"$fe\" \"$ne\" \"$arr\""}} + {{`set -euo pipefail; STATE_FILE="/srv/clipper/state/vod_seen.list"; fe=false; ne=false; arr='[]'; if [ -f "$STATE_FILE" ]; then fe=true; if [ -s "$STATE_FILE" ]; then ne=true; mapfile -t L < "$STATE_FILE"; json='['; sep=''; for id in "\${L[@]}"; do id_trim="$(printf '%s' "$id" | tr -d '\r' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"; [ -n "$id_trim" ] || continue; json+="$sep\"$id_trim\""; sep=','; done; json+=']'; arr="$json"; fi; fi; printf '{"file_exists":%s,"non_empty":%s,"vods":%s}\n' "$fe" "$ne" "$arr"`}} + ``` **Beispiele für den Output:**