Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Use 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.


agreed, 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




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: