From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from minnie.tuhs.org (minnie.tuhs.org [IPv6:2600:3c01:e000:146::1]) by inbox.vuxu.org (Postfix) with ESMTP id D54D322BF6 for ; Mon, 4 Mar 2024 03:04:08 +0100 (CET) Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id 825E84365E; Mon, 4 Mar 2024 12:04:02 +1000 (AEST) Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by minnie.tuhs.org (Postfix) with ESMTPS id 23D824365D for ; Mon, 4 Mar 2024 12:03:54 +1000 (AEST) Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-33d8739ddd4so2105494f8f.2 for ; Sun, 03 Mar 2024 18:03:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709517831; x=1710122631; darn=tuhs.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=bBSeK0NBYuo4JflJ77Qfw78D5RIXUkMQxoTDqJaMLZw=; b=TqV3eanuqpKHqHRBp1YEQUx4kDlDgRTjM2QW/Zz/F44Jna9iLk8mFHZIK9OqF9BNIa gOHzwUYBCrFuPf7bY5nM4Y8njRMLoQiq3Z0/UxX+wbCckKew4fFHoiLbV7ePiQQbnK7G 0MdEvXkBrN8I7aEkmg5OkS2MsB3jP61HxQpoaQn8uGB839WSfc09Oh6wmG5DLjzaRHdG MXH/uDMUsxI1CG7K3rOKINzDWKu766SIOHDqBUy81DFqdgfkbIPYkITudOOyHOyCm5SJ V08HKpSh5H7dooMTmZVCJeEC2th8W8mgq/+iLpBrSZSskgaYx1De0ZCOwf+kv9IMBg9+ bmYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709517831; x=1710122631; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bBSeK0NBYuo4JflJ77Qfw78D5RIXUkMQxoTDqJaMLZw=; b=rCuQJ5B77eJDkysFBJ9zuBwfvXfJFlNU3YOVlRD6lmMWmsqPvme5mgyy8/KVWggp2a VQ4g0uZIDqSlEplwycDi7CsYgo/bMxxobwr1bqpLlIdh8BGj2oWA+1gccLiL8cAll9VJ k+hIBe8/S2ylamGCRWpHNy0Ue7hR66hN7py+KB2F4ZcUMwQmHEubx1U5ln+rB3KLoEl5 +QC/PtZv/rNN4evqMz7EWEVHx7SWRtRBiH0I2RxUmdXqVpUbfnjMIuHw7wwgaJxYY1dI uHeGOq383zd/lNit2EsI5gCtCtUzyJRGmpQ5oJWdlyPIJFl6bW/lg0mpQlcsUFik9Lgf Vkqw== X-Gm-Message-State: AOJu0Yy+Hvj0lgQ4/KvSVdqjyxix4bHMWvtChj5L7984khgE/Fs66p8P ihkFTVha9+wrIbQCbX74/FbAOvZvbvnjy74vzDqEfRKH6NHaOoVdsn/8Vjpj84aDUnePi+mPA12 VGzwWGunOSdY8SHXIB4Xy12LtNw== X-Google-Smtp-Source: AGHT+IHPEFMrq7P9yJHzphlKTtUooqHD7V7lX1d4dejSQZ0n+todwd6/lFa004NnffQ74M+OX1DVctBZqaA5YNNDVnA= X-Received: by 2002:adf:e445:0:b0:33d:11e1:47d9 with SMTP id t5-20020adfe445000000b0033d11e147d9mr6257336wrm.68.1709517831261; Sun, 03 Mar 2024 18:03:51 -0800 (PST) MIME-Version: 1.0 References: <13abd764-984a-4c9f-8e3e-b1eb7c624692@gmail.com> In-Reply-To: <13abd764-984a-4c9f-8e3e-b1eb7c624692@gmail.com> From: Marc Rochkind Date: Sun, 3 Mar 2024 19:03:39 -0700 Message-ID: To: Will Senn Content-Type: multipart/alternative; boundary="00000000000011d6180612cc2344" Message-ID-Hash: HFSGY6WLD2OWMCRFXKWVOMQNESOI326U X-Message-ID-Hash: HFSGY6WLD2OWMCRFXKWVOMQNESOI326U X-MailFrom: mrochkind@gmail.com 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 CC: TUHS X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Re: regex early discussions List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --00000000000011d6180612cc2344 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Will, here's my recollection, when I got to UNIX in late 1972 or thereabouts: First, there was ed. grep and sed were derived from ed, so came along later. awk came along way later. There were only manual pages. You typed "man ed" and there it was. The man pages were very accurate, very clear, and very authoritative. Many found them too succinct, especially as UNIX got more popular, but all of us back in the day found them perfect. Maybe you had to read the man page a few times to understand it, but at least that's all you had to read. No need to hunt around for more documentation! (Well, there was more documentation: The source code, which was all online. But reading the ed source to understand regular expressions was impossible. It was in assembler, and Ken was generating code on the fly as the expression was compiled.) Also, it should be noted that ed produced a single error message: a question mark. No wasting of teletype paper! The motivation for learning regular expressions was that that's how you edited files. ed was the only game in town. (sh used a greatly restricted form of regular expressions, which were documented on the sh man page.) Marc Rochkind On Sun, Mar 3, 2024 at 6:31=E2=80=AFPM Will Senn wrot= e: > Hi All, > > I was wondering, what were the best early sources of information for > regexes and why did folks need to know them to use unix? In my recent > explorations, I have needed to have a better understanding of them, so I'= m > digging in... awk's my most recent thing and it's deeply associated with > them, so here we are. I went to the bookshelf to find something appropria= te > and as usual, I've traced to primary sources to some extent. I started wi= th > Mastering Regular Expressions by Friedl, and I won't knock it (it's one o= f > the bestsellers in our field), but it's much to long for my personal tast= e > and it's not quite as systematic as I would like (the author himself note= s > that his interests are less technical than authors preceding him on the > subject). So, back to the shelves... Bourne's, The Unix Environment, and > Kernighan & Pike's, The Unix Programming Evironment both talk about them = in > the context of grep, ed, sed, and awk. Going further back, the Unix > Programmer's Manual v7 - ed, grep, sed, awk... > > After digging around it seems like folks needed regexes for ed, grep, sed > and awk... and any other utility that leveraged the wonderful nature of > these handy expressions. Fine. Where did folks go learn them? Was there a > particularly good (succinct and accurate) source of information that folk= s > kept handy? I'm imagining (based on what I've seen) that someone might cu= t > out the ed discussion or the grep pages of the manual and tape them to > their monitors, but maybe I'm stooopid and they didn't need no stinkin' > memory device for regexes - surely they're intuitive enough that even a > simpleton could pick them up after seeing a few examples... but if that > were really the case, Friedl's book would have been a flop and it wasn't > :). So seriously, if you remember that far back - what was the definitive > source of your regex knowledge and what were the first motivators for > learning them? > > Thanks, > > Will > --=20 *My new email address is mrochkind@gmail.com * --00000000000011d6180612cc2344 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Will, here's my recollection, when I got to UNIX in la= te 1972 or thereabouts:

First, there was ed. grep and se= d were derived from ed, so came along later. awk came along way later.

There were only=C2=A0manual pages. You typed "man= ed" and there it was. The man pages were very accurate, very clear, a= nd very authoritative. Many found them too succinct, especially as UNIX got= more popular, but all of us back in the day found them perfect. Maybe you = had to read the man page a few times to understand it, but at least that= 9;s all you had to read. No need to hunt around for more documentation!

(Well, there was more documentation: The source code,= which was all online. But reading the ed source to understand regular expr= essions was impossible. It was in assembler, and Ken was generating code on= the fly as the expression was compiled.)

Also, it= should be noted that ed produced a single error message: a question mark. = No wasting of teletype paper!

The motivation for l= earning regular expressions was that that's how you edited files. ed wa= s the only game in town.

(sh used a greatly restri= cted form of regular expressions, which were documented on the sh man page.= )

Marc Rochkind

On Sun, Mar 3, 2024 at 6:= 31=E2=80=AFPM Will Senn <will.sen= n@gmail.com> wrote:
=20 =20 =20
Hi All,

I was wondering, what were the best early sources of information for regexes and why did folks need to know them to use unix? In my recent explorations, I have needed to have a better understanding of them, so I'm digging in... awk's my most recent thing and = it's deeply associated with them, so here we are. I went to the bookshelf to find something appropriate and as usual, I've traced to primary sources to some extent. I started with Mastering Regular Expressions by Friedl, and I won't knock it (it's one= of the bestsellers in our field), but it's much to long for my personal taste and it's not quite as systematic as I would like (the author himself notes that his interests are less technical than authors preceding him on the subject). So, back to the shelves... Bourne's, The Unix Environment, and Kernighan & Pike's, The Unix Programming Evironment both talk about them in the context of grep, ed, sed, and awk. Going further back, the Unix Programmer's Manual v7 - ed, grep, sed, awk...

After digging around it seems like folks needed regexes for ed, grep, sed and awk... and any other utility that leveraged the wonderful nature of these handy expressions. Fine. Where did folks go learn them? Was there a particularly good (succinct and accurate) source of information that folks kept handy? I'm imagining (based on what I've seen) that someone might cut out th= e ed discussion or the grep pages of the manual and tape them to their monitors, but maybe I'm stooopid and they didn't need n= o stinkin' memory device for regexes - surely they're intuitive enough that even a simpleton could pick them up after seeing a few examples... but if that were really the case, Friedl's book would have been a flop and it wasn't :). So seriously, if you remember that far back - what was the definitive source of your regex knowledge and what were the first motivators for learning them?

Thanks,

Will


--
My new email address is mrochkind@gmail.com
--00000000000011d6180612cc2344--