Thank you, everyone.
hello,
> for f in "/users/myname/desktop/test/input/"*.md; \
> do \
> pandoc "$f" \
> --standalone \
> -o "/users/myname/desktop/test/output/"${f%.md}.htm; \
> done
close :) this should do the trick:
base=/users/myname/desktop/test
pushd $base/input
for f in *.md ; do
pandoc "$f" -s -o $base/output/${f.md}.htm
done
popd
if you use zsh and don't care about a subshell, i would have writen
( base=/users/myname/desktop/test
cd $base/input
for f (*.md) pandoc "$f" -s -o $base/output/$f:r.htm )
however i would like to mention make as a better solution:
* a makefile to do the same job will be
BASE = /users/myname/desktop/test
SRCS != ls ${BASE}/input/*.md
PAGES = ${SRCS:${BASE}/input/%.md=${BASE}/output/%.htm}
all : ${PAGES}
${BASE}/output/%.htm: ${BASE}/input/%.md
pandoc -s -o $@ $<
clean:; rm -rf ${BASE}/o/*
* you can just type
make # build the missing pages one by one
make -j4 # build the missing pages four by four
make -b # rebuild every pages
make clean # remove all the pages
regards
marc