#! /bin/sh notes=$(find $1 -type f -name "*.md") for n in $notes; do echo "Sanitizing: $n" fn=$(cut -d'.' -f1 $n) echo $fn sed -i "#Resources/attachments#notes/$fn#g" $n done