FOERBICO/sb/scripts/get-weight-by-publishdate.sh
Ludger Sicking 6c240e5995
Some checks are pending
ci/woodpecker/push/build_and_copy_blog Pipeline is pending approval
kleine Helferlein, VORSICHT nur draft!
2024-11-23 13:02:50 +01:00

7 lines
273 B
Bash

#!/bin/bash
FILE=$1
WEIGHT="weight: -20500101"
echo "working on >>"$FILE"<<"
DETECTED_DATE=$(grep datePublished $FILE | sed -E 's/datePublished...(2024)-(..)-(..)./\1\2\3/')
echo "weight to set: >>-"$DETECTED_DATE"<<"
sed -i "s/weight: xxx/weight: -${DETECTED_DATE}/" $FILE