Sixty years of wrong DD syntax (humor)

Post tutorials, HOWTO's and other useful resources here.
nanZor
Shogun
Shogun
Posts: 489
Joined: 09 Apr 2019, 03:27
Distribution: Porteus 5.1 Alpha OpenBox

Sixty years of wrong DD syntax (humor)

Post#1 by nanZor » 30 Mar 2025, 21:13

Humor, but instructive about DD's history. You know we've been doing it wrong for sixty years right?

That is, the IF= and OF= pair is an ancient remnant from the 1960's IBM/360 mainframe JCL job control language, where when tasked with installing unix(tm), couldn't immediately grok redirection. So the IF and OF syntax remains in DD. Doug McIlroy pointed this out decades later how we can't get over it. So I searched, and saw in either the ATT Unix(tm) V6 or V7 manual (maybe it was V5, I forget) how to DD the system using redirection and my mind was blown. All these years!

Part of the problem is that books (and forums) munge whitespace making it look weird, and it wasn't until I saw the whitespace in the V7 manual, that it became clear. Because it always looked strange before, so I was afraid to doing it the "unix way". Maybe it was an early BSD install doc, I forget now... :)

I'll "mansplain" it by breaking it up. Let's say you want to DD burn your Porteus iso into the typical read-only format on a stick. I'll leave out option like bs=4M etc etc for clarity.

Part one:

Code: Select all

dd < myporteus.iso
Part two:

Code: Select all

> /dev/sdX
Put them together, but notice how it looks weird when simply adding a little whitespace between input and output, but due to munging in books and forums makes it look weird. It looks more like an option - I'm not going to try it, you try it!

Code: Select all

dd <myporteus.iso> /dev/sdX
Check this out: This is what I saw in the V7 manual (somewhere) with whitespace!

Code: Select all

dd < myporteus.iso        > /dev/sdX
BUT, when I researched how far back this goes when McIlroy first mentioned using the "unix way" of doing it, rather than the IBM/360 mainframe syntax, it was the few spaces of additonal whitespace between "iso" and the ">" redirect in that V7 manual that made the light shine!

So next time you DD, try doing it the RIGHT way! I'll bet your fingers tremble. I know mine did. :)
Last edited by nanZor on 30 Mar 2025, 23:33, edited 1 time in total.
That's a UNIX book - cool. -Garth

User avatar
Ed_P
Contributor
Contributor
Posts: 8954
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Sixty years of wrong DD syntax (humor)

Post#2 by Ed_P » 30 Mar 2025, 22:19

nanZor wrote:
30 Mar 2025, 21:13
JCL
:o There's a letter combination I haven't seen in a long, long, time. :lol:

nanZor
Shogun
Shogun
Posts: 489
Joined: 09 Apr 2019, 03:27
Distribution: Porteus 5.1 Alpha OpenBox

Sixty years of wrong DD syntax (humor)

Post#3 by nanZor » 30 Mar 2025, 23:40

Right? It's like a total secret/joke. I looked back and I even see IF/OF in the "official" old V5+ manuals. I guess for the mainframe guys who had *never* used unix redirection, and some manager told them to install it on their lunchbreak.

Seriously though, since I'm not a programmer, I don't know how incorporating "double redirection" in one line might make for tighter or faster or less resource consuming code. I can't fathom a way to test that vs say a bash script with input and outputs on separate lines with timing to see if there is a difference with double-redirection, not just for DD'ing. Maybe this should have been in the programming subforum.
That's a UNIX book - cool. -Garth

Post Reply