From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/29221 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Martin Post Newsgroups: gmane.text.pandoc Subject: Re: Absolute path in for loop / output? Date: Sat, 11 Sep 2021 12:52:04 -0700 (PDT) Message-ID: <0d4acc1e-9566-4d61-8c55-57055b19ae0en@googlegroups.com> References: <78489a20-5148-4826-ab6a-b43fa48938d4n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_4960_1671981308.1631389924795" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30746"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCHYFZ6CWYNBBZUR6SEQMGQETZVBSCQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Sep 11 21:52:08 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oo1-f60.google.com ([209.85.161.60]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mP92m-0007la-Gl for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 11 Sep 2021 21:52:08 +0200 Original-Received: by mail-oo1-f60.google.com with SMTP id bc36-20020a05682016a400b0028c8e8a2746sf3708672oob.5 for ; Sat, 11 Sep 2021 12:52:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=/hMhrYDCFP1u/bA758rT79jag3ORhvk5LRfVXvkfbC8=; b=aWvI7rU4ymXy1FR4uDuoPxLrcHz62grHcqsCrFhRZlGZKvicQMQLmjjT39erwmDLHn aadsMiJVmvNTn+epXdt813n7Eqb6i1eA/DxLuuprV9og4EG71GCgYlmTebC3kVe4tCtD CnijIopx2KXhm+9j86O8GOSkuQqE9Mwwh4RxvfpbFPD+O214y5v9S1ChcGagaav0vBj7 lWMbr6fynVJCV7Y2ebPWJQo1onfQajXp6WoICUolFgomWxw2kbE8bMSt1CJv1BcmCbIK iAiK5Tr7UdsnEcEasVWvfHg9i0mLl5VfUa41RNFuY1FCqTZRg3LTUbJ/pyyOY7DRGt4o NXBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=/hMhrYDCFP1u/bA758rT79jag3ORhvk5LRfVXvkfbC8=; b=gtv+W2YERZFQAm/T6YPn/5SdCDM+nusABTimm/X8G5LvJb1JQ8yETN4FTOgZkU+UTB v6HYKRFPw00HR/HjUL6Z4b6XabNxY5/+dRiATQcjwM7Si/3eGW4VxfcTPc4gaRL3EyyS EWcciGnWNHRTIbFUyzr2nbQ7kC+l7FAe0/pJHnuPXUBz9F9wxqUJNsGQ49iSZWmVaAyN +hDBvecjoWmwImUyoTFibpgmaUNymZcjdoAASt1+JqrfVR7TWlMBoXqjSllQfPG0jEsf D8BVsUYnbnPBL82kEzPs7IGsS9hOUlmt2w192A9yUy5tgLbP7NGGlcp4C/OaIGpu0FYY CeOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=/hMhrYDCFP1u/bA758rT79jag3ORhvk5LRfVXvkfbC8=; b=CQUp7XKDiK0Wu2sIVlGDJVfbW9pIpmfG9hl4g2l0JDyuUNLRxRmm3H9+21cX0BcUws cWI1orw6S2kyZfJKhRwzHILn4JQnYVdFFC+m1PN7SFJoF0/lqh9QJl7NFb+AsvyxVqC1 gBwdD5ea4fqV6eNbQSuV1nosdt9oTIYpt4Sd4NXIr1IG9ykfL71jqBGMMSuDAnfgIHM8 15/IkP3vd/liLZtNSGuv10OH5gZ1Zj9E4UWCQB90JESHz32syi0dQkzJQf0azsOcR3fD tmyPQe/FXfDQhjywiAZft8X43COJJP1vsBreasR+BOx7Fdrw6c1TUKI3M9Q3367nZ4mM BAaA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM530vF7y1/XB71mHAZuN/4s3MTtkbgx6Y9KNmY0E5H6fH1YSR9xbP fe8P2r+rOo5n+8F5M60v3Fs= X-Google-Smtp-Source: ABdhPJyplg2x/HAzkiW41jBV3rRGX754F4m5gW21NVX8J73NDmYyfMigr4A5P+Co5JAiaDBY6i5jKw== X-Received: by 2002:a05:6808:150:: with SMTP id h16mr2790960oie.25.1631389927436; Sat, 11 Sep 2021 12:52:07 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:aca:53d2:: with SMTP id h201ls2346227oib.0.gmail; Sat, 11 Sep 2021 12:52:05 -0700 (PDT) X-Received: by 2002:aca:1709:: with SMTP id j9mr2837459oii.120.1631389925348; Sat, 11 Sep 2021 12:52:05 -0700 (PDT) In-Reply-To: X-Original-Sender: MartinPostBerlin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:29221 Archived-At: ------=_Part_4960_1671981308.1631389924795 Content-Type: multipart/alternative; boundary="----=_Part_4961_1971557330.1631389924795" ------=_Part_4961_1971557330.1631389924795 Content-Type: text/plain; charset="UTF-8" Thank you, everyone. @ Marc: This is exactly what I was looking for. On Tuesday, September 7, 2021 at 9:26:24 PM UTC+2 ei...-fbXiWI9j2LLYtjvyW6yDsg@public.gmane.org wrote: > 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 > -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/0d4acc1e-9566-4d61-8c55-57055b19ae0en%40googlegroups.com. ------=_Part_4961_1971557330.1631389924795 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you, everyone. 

@ Marc: This is exactly = what I was looking for.

On Tuesday, September 7, 2021 at 9:26:24 PM UTC= +2 ei...-fbXiWI9j2LLYtjvyW6yDsg@public.gmane.org wrote:
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=3D/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=3D/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 =3D /users/myname/desktop/test
SRCS !=3D ls ${BASE}/input/*.md
PAGES =3D ${SRCS:${BASE}/input/%.md=3D${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

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d= /msgid/pandoc-discuss/0d4acc1e-9566-4d61-8c55-57055b19ae0en%40googlegroups.= com.
------=_Part_4961_1971557330.1631389924795-- ------=_Part_4960_1671981308.1631389924795--