FOERBICO/sb/scripts/get-weight-by-publishdate.sh

7 lines
273 B
Bash
Raw Permalink Normal View History

#!/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