From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5350 invoked from network); 27 Jun 2023 06:28:46 -0000 Received: from minnie.tuhs.org (2600:3c01:e000:146::1) by inbox.vuxu.org with ESMTPUTF8; 27 Jun 2023 06:28:46 -0000 Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id 510F640BE3; Tue, 27 Jun 2023 16:28:45 +1000 (AEST) Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by minnie.tuhs.org (Postfix) with ESMTPS id 92DF340BB6 for ; Tue, 27 Jun 2023 16:28:37 +1000 (AEST) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3fa9850bfd9so16987195e9.0 for ; Mon, 26 Jun 2023 23:28:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687847315; x=1690439315; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=bx553U807NwsVkm4wphse3N0G6CBxdXNr8KfM7g6suY=; b=pNF7XcUMeUISjprp+P1KSKMF5J6HKtkdnf1FIgbCR/QmYCwVPKVkcPYDrO0MlNtAnh xzFSWDO8ppp7PuDiq4erVaV0AgmkixtunDahY8+FgFR8QQB+cdv036DF3oPsshHe/o2S hVw4iDsPhCSszcQZYE8RRaIWHWmfflepyclRQotD52ZYZHDss8XO+dHBdghh1IYQoS0p /frMFgK94kJdxs7yeDbQnU/WKXpEBudCdMg6hI/85PsbDQedpeS1X4w8+gimVK+hAe+n lKTxgnS9x4ufhNurYdMBm1OL7uXnkNyX4INeG2n3oxYgtL1ZhVYVPx57KON+lNBVhpqj SwBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687847315; x=1690439315; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bx553U807NwsVkm4wphse3N0G6CBxdXNr8KfM7g6suY=; b=DxmHpPHbat738HucG4r99/1/hN/tf/Ja96LLgfBBGtiMNN3b0w7rgL50LDSm2s9Gs+ r7oPL/b7OzrHhDbpZXQQXTkMWPR065iMUXO+8TrF3JizxMN81HgESu7LUCiVkvFrUOqO AtKqESvVAp+gVV4aMJB5w0k67e5IIzf0p2zRKZLNH7xhFSzKSK2TYKUEosEDVSGc9Odg hmY8KNzoEj3kzyoKnBcFO9m56rQHfya1SeFC627gRijF5ljv4strzSVSY50NEox9vRTk RSMv6M+oibxDJYuc0tRQWZNoo8W1DGSvXY7KWoxFuRQWEnsVTizDDFBEY8Mvs9HHJVSM PHiA== X-Gm-Message-State: AC+VfDzYqH9rQHuhDhYdUYMP4Ko+pA16g8XB3buV3OvLIw5mdbLb5XZw 4hCNNRMznS3tLGZrH0pCxD5gPdwBw5XVgiKIdecwCi11mUA= X-Google-Smtp-Source: ACHHUZ7bg5BLGE4PeKPRXOJpRkE0X/RuoBxQZpATBTVohXwH7zMyUyycg/TLL5HoJW9uoDdSyw8CSt1o38xyY1r5apE= X-Received: by 2002:a1c:ed0b:0:b0:3f5:39:240c with SMTP id l11-20020a1ced0b000000b003f50039240cmr10937171wmh.27.1687847315116; Mon, 26 Jun 2023 23:28:35 -0700 (PDT) MIME-Version: 1.0 References: <20230627062316.858C6220E5@orac.inputplus.co.uk> In-Reply-To: <20230627062316.858C6220E5@orac.inputplus.co.uk> From: Adam Thornton Date: Mon, 26 Jun 2023 23:28:24 -0700 Message-ID: To: Computer Old Farts Followers Content-Type: multipart/alternative; boundary="000000000000a717c205ff169374" Message-ID-Hash: VCBVP2F54B4LOAJLQOACYJKF7VXTGQKB X-Message-ID-Hash: VCBVP2F54B4LOAJLQOACYJKF7VXTGQKB X-MailFrom: athornton@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [COFF] Re: Shell script advice: using 'dd' to write multiple media List-Id: Computer Old Farts Forum Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --000000000000a717c205ff169374 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable My approach would have been to use "split" on the original file and then dd the resulting files. But now I find myself wondering how old "split" is. It was certainly already a well-established thing by the early 90s. On Mon, Jun 26, 2023 at 11:23=E2=80=AFPM Ralph Corderoy wrote: > Hi Steve, > > > I=E2=80=99ve never figured out how to use =E2=80=98dd=E2=80=99 so it re= turns after a single > > block is written doesn=E2=80=99t close the input, killing the pipeline,= or > > cause the rest of the data to be discarded. > > I think this meets your description and complies with POSIX's dd(1p) > here. > > $ seq 33 126 | sed 's/$/P/' | dc | > > while :; do > > LC_ALL=3DC dd bs=3D10 count=3D1 2>dd.err | sed -n l > > grep -q '^[^0].* records in$' dd.err || break > > done > !"#$%&'()*$ > +,-./01234$ > 56789:;<=3D>$ > ?@ABCDEFGH$ > IJKLMNOPQR$ > STUVWXYZ[\\$ > ]^_`abcdef$ > ghijklmnop$ > qrstuvwxyz$ > {|}~$ > $ > $ rm dd.err > > I set the locale so the format of dd's stderr report is known. > > -- > Cheers, Ralph. > --000000000000a717c205ff169374 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
My approach would have been to use "split" on th= e original file and then dd the resulting files.=C2=A0 But now I find mysel= f wondering how old "split" is.=C2=A0 It was certainly already a = well-established thing by the early 90s.

On Mon, Jun 26, 2023 at 11:23= =E2=80=AFPM Ralph Corderoy <ral= ph@inputplus.co.uk> wrote:
Hi Steve,

> I=E2=80=99ve never figured out how to use =E2=80=98dd=E2=80=99 so it r= eturns after a single
> block is written doesn=E2=80=99t close the input, killing the pipeline= , or
> cause the rest of the data to be discarded.

I think this meets your description and complies with POSIX's dd(1p) here.

=C2=A0 =C2=A0 $ seq 33 126 | sed 's/$/P/' | dc |
=C2=A0 =C2=A0 > while :; do
=C2=A0 =C2=A0 >=C2=A0 =C2=A0 =C2=A0LC_ALL=3DC dd bs=3D10 count=3D1 2>= dd.err | sed -n l
=C2=A0 =C2=A0 >=C2=A0 =C2=A0 =C2=A0grep -q '^[^0].* records in$'= dd.err || break
=C2=A0 =C2=A0 > done
=C2=A0 =C2=A0 !"#$%&'()*$
=C2=A0 =C2=A0 +,-./01234$
=C2=A0 =C2=A0 56789:;<=3D>$
=C2=A0 =C2=A0 ?@ABCDEFGH$
=C2=A0 =C2=A0 IJKLMNOPQR$
=C2=A0 =C2=A0 STUVWXYZ[\\$
=C2=A0 =C2=A0 ]^_`abcdef$
=C2=A0 =C2=A0 ghijklmnop$
=C2=A0 =C2=A0 qrstuvwxyz$
=C2=A0 =C2=A0 {|}~$
=C2=A0 =C2=A0 $
=C2=A0 =C2=A0 $ rm dd.err

I set the locale so the format of dd's stderr report is known.

--
Cheers, Ralph.
--000000000000a717c205ff169374--