FOERBICO/sb/scripts/replace-absolute-path-by-relative.sh

10 lines
383 B
Bash
Raw Normal View History

#!/bin/bash
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
# Aufruf z. B. durch `$ sb/scripts/replace-absolute-path-by-relative.sh sb/content/hello-world/index.md`