Wandering Thoughts archives


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

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.

unix/CutCommandHistory written at 23:12:09; Add Comment

Page tools: See As Normal.
Login: Password:
Atom Syndication: Recent Pages, Recent Comments.

This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.