You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
427 B
Bash

#! /bin/sh
echo "scanning $1 for attachments"
noteName=$(echo $1|awk -F'/' '{print $(NF-1)}')
attachments=$(cat $1|egrep "\[\[(Resources\/attachments\/.*?)\]\]"|tr -d '![]'|awk -F'/' '{print $(NF)}')
echo "Found Attachments:"
echo $attachments
for a in $attachments; do
# echo "find . -name $a -exec mv {} /tmp/blog/content/notes/$noteName/$a \;"
find . -name $a -exec mv {} /tmp/blog/content/notes/$noteName/$a \;
done