Created
March 17, 2016 16:37
-
-
Save selbyk/88e33f340db812902a24 to your computer and use it in GitHub Desktop.
Format ms power point slide text from operating systems into markdown
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 | |
# Usage: ./replace.sh | |
#* Adapted from slides by Reva Freedman (The UNIX Systems), NIU | |
### Feng Chen | |
### Tue/Thu 5:00-6:30PM | |
#1120 Patrick F. Taylor Hall | |
# https://github.com/selbyk/operating-systems | |
FILE="16.shell.programming.md" | |
shopt -s extglob | |
for FILE in {9,1[0-5]}.*.md | |
do | |
sed -i.bak -e "s/^.*Cont.)//gm" $FILE | |
sed -i.bak -e "s/^.*, LSU$//gm" $FILE | |
sed -i.bak -e "s/Feng Chen.*Chapter [0-9]*//gm" $FILE | |
sed -i.bak -e "s/^■ /- /gm" $FILE | |
sed -i.bak -e "s/^• / - /gm" $FILE | |
sed -i.bak -e "s/^● / - /gm" $FILE | |
sed -i.bak -e "s/^! / - /gm" $FILE | |
sed -i.bak -r "s/^^([A-Z].+)/### \1/gm" $FILE | |
sed -i.bak -r "s/^- ([a-zA-Z]*) –/- **\1** –/gm" $FILE | |
sed -i.bak -r "s/### (.*)===$/\1\n===/" $FILE | |
done | |
rm ./*.bak |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment