From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from minnie.tuhs.org (minnie.tuhs.org [45.79.103.53]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 4ef38a33 for ; Sat, 18 Jan 2020 18:45:56 +0000 (UTC) Received: by minnie.tuhs.org (Postfix, from userid 112) id 4D1EE9C0FE; Sun, 19 Jan 2020 04:45:55 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id DDFBB9C0F7; Sun, 19 Jan 2020 04:45:35 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id AC0349C0F7; Sun, 19 Jan 2020 04:45:33 +1000 (AEST) Received: from fourwinds.com (fourwinds.com [63.64.179.162]) by minnie.tuhs.org (Postfix) with ESMTPS id 8C4D29BDD8 for ; Sun, 19 Jan 2020 04:45:32 +1000 (AEST) Received: from darkstar.fourwinds.com (localhost [127.0.0.1]) by fourwinds.com (8.15.2/8.15.2) with ESMTPS id 00IIjTM72543515 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Sat, 18 Jan 2020 10:45:29 -0800 Received: from darkstar.fourwinds.com (jon@localhost) by darkstar.fourwinds.com (8.15.2/8.15.2/Submit) with ESMTP id 00IIjSRE2543512 for ; Sat, 18 Jan 2020 10:45:28 -0800 Message-Id: <202001181845.00IIjSRE2543512@darkstar.fourwinds.com> From: Jon Steinhart To: The Eunuchs Hysterical Society In-reply-to: References: <202001121343.00CDhYHK132101@tahoe.cs.Dartmouth.EDU> <202001122034.00CKYQ39571239@darkstar.fourwinds.com> <202001122044.00CKiUNV573279@darkstar.fourwinds.com> <202001122137.00CLbMrw582813@darkstar.fourwinds.com> Comments: In-reply-to Michael Parson message dated "Sat, 18 Jan 2020 09:45:22 -0600." MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2543510.1579373128.1@darkstar.fourwinds.com> Date: Sat, 18 Jan 2020 10:45:28 -0800 X-JON-SPAM: local delivery Subject: Re: [TUHS] Tech Sq elevator (Was: screen editors) [ really I think efficiency now ] X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" Michael Parson writes: > On Mon, 13 Jan 2020, Dan Cross wrote: > > > > [Resending as this got squashed a few days ago. Jon, sorry for the > > duplicate. Again.] > > > > On Sun, Jan 12, 2020 at 4:38 PM Jon Steinhart wrote: > > > > >> Many people have claimed, incorrectly in my opinion, that this model > >> fails in the modern era because it only works on text data. They > >> change the subject when I point out that ImageMagick works on binary > >> data. And, there are now stream processing utilities for JSON data > >> and such that show that the UNIX model still works IF you understand > >> it and know how to use it. > > > > > > Certainly. I think you hit the nail on the head with the proviso > > that one must _understand_ the Unix model and how to use it. If one > > does so, it's very powerful indeed, and it really is applicable more > > often than not. But it is not a panacea (not that anyone suggested it > > is). As an example, how do I apply an unmodified `grep` to arbitrary > > JSON data (which may span more than one line)? Perhaps there is a way > > (I can imagine a 'record2line' program that consumes a single JSON > > object and emits it as a syntactically valid one-liner...) but I can > > also imagine all sorts of ways that might go wrong. > > And here, understanding the model is important, namely, grep is the > wrong tool for searching/parsing JSON output. Dealing with JSON from the > shell, you should use jq. I've been dragged kicking and screaming into > dealing with JSON, and about all I can say about it is, I like it about > this >< much more than XML. :) > > -- > Michael Parson > Pflugerville, TX > KF5LGQ Slight disagreement here. I would say that grep is *a* a tool for JSON and that jq is *a better* one. The UNIX model part of this is that jq is another tool in a toolbox and plays well with others. What disturbs me about a lot of software (and my tractor) it when it does the equivalent of throwing a random metric bolt into something that's built from SAE hardware. Jon