From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/33140 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Martin Post Newsgroups: gmane.text.pandoc Subject: Shell (zsh) for loop: apply correct suffix based on Pandoc output format? Date: Mon, 2 Oct 2023 06:58:57 -0700 (PDT) Message-ID: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_20225_34002031.1696255137910" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13317"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCHYFZ6CWYNBBI4Z5OUAMGQEMT2T7WY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Oct 02 15:59:03 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oo1-f57.google.com ([209.85.161.57]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qnJRu-00039U-Sk for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 02 Oct 2023 15:59:02 +0200 Original-Received: by mail-oo1-f57.google.com with SMTP id 006d021491bc7-57b5f0d655esf3577438eaf.0 for ; Mon, 02 Oct 2023 06:59:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1696255141; x=1696859941; darn=m.gmane-mx.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:message-id:to:from:date:sender:from:to:cc :subject:date:message-id:reply-to; bh=l88OKVPz8xSQI9lpqzJoX3xtEzJpFDHlVcV5ebZgbhc=; b=bT+7CP7orXo2LZWGCig1ec0oqHqUn7mIG7uG+eypleQDiWxwg86Wj0n10QmxWFbslZ NaLanhX0GGV8xIVuxBM6oM9axWGXuG2mwJux/tBf0SEmCcRcY5Lc6jFQPveg4TI18deZ PuRS90yySn6LFWaGKxYvkkjsqMrAXrVjqZCXjUOR10Wrxpxi0+uYBFg9R4dCNDvJCPSg /R0AAP98RRdUXJVAJQu2p67by+CPaWlqgeTdkGeip/fR204B3up7Hg02zC2uCLr/A/WK 4OwjGJSeYUB1OGtGOwLa8Kn7adZeonXlNZksgt9Nbmlu5skwYtsxu9vSTpJQvkhT5rzy d6sA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696255141; x=1696859941; darn=m.gmane-mx.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:message-id:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=l88OKVPz8xSQI9lpqzJoX3xtEzJpFDHlVcV5ebZgbhc=; b=JpvTwhq+2aCHqnSrs8/w508a07CK+qlkdw+2ijXaWeOO5v5wI9sXGVzcgjJpwG8QU1 QEYh/DwkyE9RtY/G7sM4IwtnUa2tAfCuk0KpMFJ+ceBdQOLbnWc31oR9ZhGuY1Fb+GUg mcKwJGzAVkKZOq493DmOdzNLoqWTlawoznpw1gh06eiBfgHicyzJ08dMmjRjmYCXLcAu UavBDtTQecAdj9x0mNWA8//SrUM9E14i0mnEJw3xmvyO3OPNRUf/YIT5zWGLsp95/8JE IbhM7zAfgV/4JjwZ2zusOkfYBCk5X0UKZpt1fYgXNUHfs6487w+OWJseuuH/0I+0zMr5 Q8SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696255141; x=1696859941; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-sender:mime-version:subject:message-id:to:from:date :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=l88OKVPz8xSQI9lpqzJoX3xtEzJpFDHlVcV5ebZgbhc=; b=kYG4q3kM6L3eaKwLxYMUWn0JH78l+NFYqVieSVwn5B7UtHNMt9zv5+HVXkXeoSCJaB Vj4UHcPpW3lUbXfWriIZI75qgkNAeZfzu7WwURN8l0O9EApsQkzqIWeUk8p5Y/oOtjPw 5u9THkEQ3zcPOJS0XFgmQ8ii3zOcx71P2NKmS2jaGm/iwTDH6yTSTpMw2JuQbbg9wxn1 0xs1J6Td3oXFCJjdVjPMzNn+dw7F4E40itYjKuYQI33tk/okoQVUBbm00FDtCkvzMx+q woK9woT7HLrtVLkJKVKbaWnBCVwmaHha/aHYuWRYhki0gyFSenDMuOC06CnUBHzSqI3I Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOJu0YwsQRggg33NY/esOuy/S5uW8rmVGT4rB4j6FLmxdTF67DQX1H2D iVJCVuENs9Gp1BlwRwUu1Nw= X-Google-Smtp-Source: AGHT+IEvowi7R1MKs0vyGnYjVMfxWCwT7KXmkiCoNXzHP11OvTnlmXu32YKytoQpV/79jSf9WPimaw== X-Received: by 2002:a05:6871:687:b0:1c8:c9ca:7092 with SMTP id l7-20020a056871068700b001c8c9ca7092mr6979899oao.11.1696255141595; Mon, 02 Oct 2023 06:59:01 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6871:6ab:b0:1b3:a2b3:6b5d with SMTP id l43-20020a05687106ab00b001b3a2b36b5dls535334oao.1.-pod-prod-08-us; Mon, 02 Oct 2023 06:58:58 -0700 (PDT) X-Received: by 2002:a05:6870:c784:b0:1e1:509:417a with SMTP id dy4-20020a056870c78400b001e10509417amr4853435oab.3.1696255138402; Mon, 02 Oct 2023 06:58:58 -0700 (PDT) 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:33140 Archived-At: ------=_Part_20225_34002031.1696255137910 Content-Type: multipart/alternative; boundary="----=_Part_20226_1310134917.1696255137910" ------=_Part_20226_1310134917.1696255137910 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I used to do this (in macOS / zsh), as seen in the Pandoc FAQ: for f in *.md; do pandoc \ --defaults=3Ddefaults.yml \ "$f" \ --output=3D"${f%.md}.htm"; done But I am now changing output formats in defaults.yml (or additional default= =20 files), e.g. =E2=80=9Cto: docx=E2=80=9D, and the target files obviously sho= uldn=E2=80=99t have=20 =E2=80=9C.htm=E2=80=9D then. How can I modify the for loop so the correct suffix is applied for the=20 output format set in a defaults file? (I realize I could manually add a =E2=80=9Coutput-format-suffix=E2=80=9D sh= ell variable and=20 use that in the loop, but I hope there=E2=80=99s something more elegant tha= n that.) Thank you. --=20 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 e= mail 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/e8d686ec-e667-4dff-97c3-133af2a6f731n%40googlegroups.com. ------=_Part_20226_1310134917.1696255137910 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I used to do this (in macOS / zsh), as seen in the Pandoc FAQ:

f= or f in *.md;
do pandoc \
--defaults=3Ddefaults.yml \
"$f" \=
--output=3D"${f%.md}.htm";
done

But I am now changing= output formats in defaults.yml (or additional default files), e.g. =E2=80= =9Cto: docx=E2=80=9D, and the target files obviously shouldn=E2=80=99t have= =E2=80=9C.htm=E2=80=9D then.

How can I modify the for loop so t= he correct suffix is applied for the output format set in a defaults file?<= br />
(I realize I could manually add a =E2=80=9Coutput-format-suffix= =E2=80=9D shell variable and use that in the loop, but I hope there=E2=80= =99s something more elegant than that.)

Thank you.

--
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/e8d686ec-e667-4dff-97c3-133af2a6f731n%40googlegroups.= com.
------=_Part_20226_1310134917.1696255137910-- ------=_Part_20225_34002031.1696255137910--