Last active
March 2, 2019 15:32
-
-
Save bryanmr/fbe7cbffe0f2eb0e7a78634b541ef1da to your computer and use it in GitHub Desktop.
A quick awk thing I wrote to strip out dead links for images from Jekyll posts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rm -rf /var/tmp/cleaned_posts | |
mkdir -p /var/tmp/cleaned_posts | |
while read -r post ; do | |
awk '/image:/ { our_image=$2 } /<img class/ { print "![For the Cure of Text](" our_image ")";next } { print $0 }' "$post" > /var/tmp/cleaned_posts/"$post" | |
done <<< "$(find . -name "*.md")" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment