2md 306 B

12345678910111213141516
  1. #!/bin/bash
  2. # Usage: html2md /path/to/file
  3. # Set $IFS so that filenames with spaces don't break the loop
  4. SAVEIFS=$IFS
  5. IFS=$(echo -en "\n\b")
  6. # Loop through path provided as argument
  7. for x in $(find $@ -name '*.html')
  8. do
  9. pandoc -f html -t markdown -o $x.md $x
  10. done
  11. # Restore original $IFS
  12. IFS=$SAVEIFS