2024-10-30 10:49:59 +00:00
|
|
|
#!/bin/bash
|
2024-10-30 11:17:17 +00:00
|
|
|
|
|
|
|
SCRIPT_TMP_DIR='.tmp-3misn'
|
|
|
|
mkdir -p $SCRIPT_TMP_DIR
|
|
|
|
sed 's#http.*://oer.community/wp-content/uploads/.*/##g' $1 > $SCRIPT_TMP_DIR/out1
|
|
|
|
sed 's#http.*://pad..*/upload.*/##g' $SCRIPT_TMP_DIR/out1 > $SCRIPT_TMP_DIR/out2
|
|
|
|
cat $SCRIPT_TMP_DIR/out2
|
|
|
|
rm -rf $SCRIPT_TMP_DIR
|
2024-10-30 10:49:59 +00:00
|
|
|
|
2024-11-04 10:44:24 +00:00
|
|
|
# Aufruf z. B. durch `$ sb/scripts/replace-absolute-path-by-relative.sh sb/content/hello-world/index.md`
|
|
|
|
|
|
|
|
# $ cd sb/content/
|
|
|
|
# $ replace.sh $blogpost-folder/index.md > $blogpost-folder/rel-index.md
|
|
|
|
# $ mv index.md abs-index.md && mv rel-index.md index.md
|