Skip to content

Instantly share code, notes, and snippets.

@djptek
Last active September 17, 2019 09:50
Show Gist options
  • Save djptek/ff478ef65a7e03d07c11f363ead3383e to your computer and use it in GitHub Desktop.
Save djptek/ff478ef65a7e03d07c11f363ead3383e to your computer and use it in GitHub Desktop.
asciidoc to solution
#!/bin/bash
mkdir -p ../solutions
cat lab[1-4].asciidoc | sed -E "s/^\[\[(lab_[1-4])\]\]/### \1 ###/" | sed -e "s/^+$/#/" | grep -v "^[[+\.|-]" | grep -v "link:\|image:\|include:" | grep -e "^PUT\|^GET\|^DELETE\|^POST\|^#\|^[ ]*[{}\",]\|^ [ ]*[-0-9]\|\[\|\]\|ctx\." | sed '$!N; /^\(.*\)\n\1$/!P; D' > ../solutions/labs_1-4_solutions.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment