Computer Old Farts Forum
 help / color / mirror / Atom feed
From: Adam Thornton <athornton@gmail.com>
To: Computer Old Farts Followers <coff@tuhs.org>
Subject: [COFF] Re: Shell script advice: using 'dd' to write multiple media
Date: Mon, 26 Jun 2023 23:28:24 -0700	[thread overview]
Message-ID: <CAP2nic33Y72qL3t=+t54tRzTwYGT4MhCz1qsg0cs5VaLg_f51Q@mail.gmail.com> (raw)
In-Reply-To: <20230627062316.858C6220E5@orac.inputplus.co.uk>

[-- Attachment #1: Type: text/plain, Size: 1120 bytes --]

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 PM Ralph Corderoy <ralph@inputplus.co.uk>
wrote:

> Hi Steve,
>
> > I’ve never figured out how to use ‘dd’ so it returns after a single
> > block is written doesn’t 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=C dd bs=10 count=1 2>dd.err | sed -n l
>     >     grep -q '^[^0].* records in$' dd.err || break
>     > done
>     !"#$%&'()*$
>     +,-./01234$
>     56789:;<=>$
>     ?@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.
>

[-- Attachment #2: Type: text/html, Size: 1593 bytes --]

  reply	other threads:[~2023-06-27  6:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26 23:09 [COFF] " steve jenkin
2023-06-26 23:21 ` [COFF] " Dave Horsfall
2023-06-26 23:44   ` steve jenkin
2023-06-27 21:01     ` Dave Horsfall
2023-06-26 23:32 ` Clem Cole
2023-06-27  4:43   ` Steve Jenkin
2023-06-26 23:44 ` Bakul Shah
2023-06-27  3:47   ` Steve Jenkin
2023-06-27 15:50     ` Steffen Nurpmeso
2023-06-27 16:07       ` Steffen Nurpmeso
2023-06-27  0:25 ` segaloco via COFF
2023-06-27  6:23 ` Ralph Corderoy
2023-06-27  6:28   ` Adam Thornton [this message]
2023-06-27  6:33     ` Ralph Corderoy
2023-06-27  7:53   ` steve jenkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP2nic33Y72qL3t=+t54tRzTwYGT4MhCz1qsg0cs5VaLg_f51Q@mail.gmail.com' \
    --to=athornton@gmail.com \
    --cc=coff@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).