The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Michael Parson <mparson@bl.org>
To: The Eunuchs Hysterical Society <tuhs@tuhs.org>
Subject: Re: [TUHS] Tech Sq elevator (Was: screen editors) [ really I think efficiency now ]
Date: Sat, 18 Jan 2020 12:59:45 -0600 (CST)	[thread overview]
Message-ID: <alpine.NEB.2.21.2001181257190.676@neener.bl.org> (raw)
In-Reply-To: <202001181845.00IIjSRE2543512@darkstar.fourwinds.com>

On Sat, 18 Jan 2020, Jon Steinhart wrote:
> 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 <jon@fourwinds.com> wrote:
>>
>> <snip>
>>
>>>> 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.

OK, yeah, I'll use grep to find what I'm looking for in the json output,
then fight with^W^Wuse jq to extract the info I'm looking for in the json
output.

> 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
>

-- 
Michael Parson
Pflugerville, TX
KF5LGQ

  reply	other threads:[~2020-01-18 19:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-12 13:43 [TUHS] Tech Sq elevator (Was: screen editors) Doug McIlroy
2020-01-12 16:56 ` Warner Losh
2020-01-12 17:21   ` markus schnalke
2020-01-12 20:25   ` Kevin Bowling
2020-01-12 20:32     ` Larry McVoy
2020-01-12 20:34     ` Jon Steinhart
2020-01-12 20:40       ` Kevin Bowling
2020-01-12 20:44         ` Jon Steinhart
2020-01-12 21:03           ` Kevin Bowling
2020-01-12 21:37             ` [TUHS] Tech Sq elevator (Was: screen editors) [ really I think efficiency now ] Jon Steinhart
     [not found]               ` <CAEoi9W4fXLaTRM1mv4wnVbifCFBEw_iKL9cds8ds-FBRTwM-=g@mail.gmail.com>
     [not found]                 ` <CAEoi9W6LedGGjWPO=ZgZzVdGLqs8drhqcWkvA_DfKTOtMDgegQ@mail.gmail.com>
2020-01-13 23:46                   ` Dan Cross
2020-01-14 23:17                     ` Kevin Bowling
2020-01-18 15:45                     ` Michael Parson
2020-01-18 18:45                       ` Jon Steinhart
2020-01-18 18:59                         ` Michael Parson [this message]
2020-01-18 20:31                           ` Adam Thornton
2020-01-21 21:57                       ` Derek Fawcus
2020-01-22  7:21                         ` arnold
2020-01-22  7:29                           ` Tyler Adams
2020-01-12 21:41           ` [TUHS] Tech Sq elevator (Was: screen editors) Bakul Shah
2020-01-12 21:47             ` Jon Steinhart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.NEB.2.21.2001181257190.676@neener.bl.org \
    --to=mparson@bl.org \
    --cc=tuhs@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).