Kapitel 13/Tutorial.md aktualisiert
This commit is contained in:
@@ -363,7 +363,8 @@ Im Ergebnis findest du im Feld `data[0].id` deine **User-ID** (z. B. `123456789`
|
|||||||
**Command (als Expression):**
|
**Command (als Expression):**
|
||||||
|
|
||||||
```js
|
```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:**
|
**Beispiele für den Output:**
|
||||||
|
|||||||
Reference in New Issue
Block a user