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=-1.0 required=5.0 tests=MAILING_LIST_MULTI, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9449 invoked from network); 27 Jun 2023 07:53:58 -0000 Received: from minnie.tuhs.org (50.116.15.146) by inbox.vuxu.org with ESMTPUTF8; 27 Jun 2023 07:53:58 -0000 Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id B3E1840BE2; Tue, 27 Jun 2023 17:53:55 +1000 (AEST) Received: from lists.tip.net.au (pasta.tip.net.au [IPv6:2401:fc00:0:129::2]) by minnie.tuhs.org (Postfix) with ESMTPS id 891D240BB6 for ; Tue, 27 Jun 2023 17:53:47 +1000 (AEST) Received: from [192.168.1.5] (ppp118-208-161-109.cbr-trn-nor-bras39.tpg.internode.on.net [118.208.161.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailhost.tip.net.au (Postfix) with ESMTPSA id 4QqxmS2L2Hz9QLr; Tue, 27 Jun 2023 17:53:43 +1000 (AEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) From: steve jenkin In-Reply-To: <20230627062316.858C6220E5@orac.inputplus.co.uk> Date: Tue, 27 Jun 2023 17:53:41 +1000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20230627062316.858C6220E5@orac.inputplus.co.uk> To: COFF X-Mailer: Apple Mail (2.3445.104.21) Message-ID-Hash: PLW2SVTUZEKFUONMHQOXQDOGXSW5VJL4 X-Message-ID-Hash: PLW2SVTUZEKFUONMHQOXQDOGXSW5VJL4 X-MailFrom: sjenkin@canb.auug.org.au 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: Ralph, Nice solution: examine dd=E2=80=99s STDERR then =E2=80=98break=E2=80=99. Thanks for the test script - I like your generation of characters using = =E2=80=98dc=E2=80=99. cheers! steve > On 27 Jun 2023, at 16:23, Ralph Corderoy = wrote: >=20 > Hi Steve, >=20 >> I=E2=80=99ve never figured out how to use =E2=80=98dd=E2=80=99 so it = returns 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. >=20 > I think this meets your description and complies with POSIX's dd(1p) > here. >=20 > $ 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 >=20 > I set the locale so the format of dd's stderr report is known. >=20 > --=20 > Cheers, Ralph. -- Steve Jenkin, IT Systems and Design=20 0412 786 915 (+61 412 786 915) PO Box 38, Kippax ACT 2615, AUSTRALIA mailto:sjenkin@canb.auug.org.au http://members.tip.net.au/~sjenkin