Where cut comes into Unix (and a bit on the history of awk)

March 14, 2022

The cut command is in some ways one of those little Unix oddities, because in many ways (although not all of them) it duplicates the functionality of awk. Both commands have been part of my Unix landscape for long enough that I don't think about where they come from, but today I wound up curious about cut's history.

Awk famously comes from V7 Unix, and is one of the signature Unix programs introduced there (see the Wikipedia entry for more). By contrast, cut comes from System III and may have at least partially reached the rest of the world through being part of POSIX (as per the Wikipedia entry). In the BSD line, cut seems to have taken until 4.3BSD-Reno to show up, around 1990, although I think that commercial Unix vendors who used BSD Unix, such as Sun, might have added it earlier.

The motivations for adding cut to System III aren't clear, but System III itself is a mix of various other early Unixes, some of which predate V7 (PWB/Unix started out based on V6, for example). It's possible that cut was written for one of these early internal AT&T Unixes that were based on something before V7 and so didn't have awk. Alternately, some of the 'line of business' work that System III and other early Unixes were used for needed to deal with files that had fixed character positions but not useful awk-style whitespace separated field divisions.

(For what it's worth, the System III cut manpage specifically mentions 'character positions as on a punched card' as an example for fields.)

PS: paste(1) also seems to have first appeared in System III, unsurprisingly.

Comments on this page:

'cut'(1), 'grep'(1), 'paste'(1) were meant to mimic relational theory's projection, selection, join operators.

Based on my early experiences with Idris (originally a 6th Ed clean-room clone), and conversations with ex-Bell staff at Whitesmiths, IIRC 'cut' might have been introduced in PWB. ???

Written on 14 March 2022.
« We do see ZFS checksum failures, but only infrequently
How Linux dynamic loaders can be both shared objects and executables »

Page tools: View Source, View Normal, Add Comment.
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Mon Mar 14 23:12:09 2022
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.