5 ms·
pandoc dir/*.md --to html should work.
by graphene 12y ago
pandoc dir/*.md --to html
should work.
- Siecje 12y agoThat will print it in the terminal but how do I save each .md file as a .html file?
- jfb 12y agoUse a for loop? for f in *.md; do pandoc $f --to html > $(basename -s.md $f).html done EDIT to fix the adjectival basename call.
- q_revert 12y agoagreed, this is exactly the sort of thing for loops in shell are useful for.. incidentally, in zsh you can do this with for f (*.md) pandoc $f --to html > $f:r.html personally I find that when I can fit a loop on a single line in zsh I'm much more inclined to use them