I very strongly recommend against doing it this way, for several reasons: First, you're using the shell's features, namely piping a file into jq when that's not necessary - jq filter files works just as well.

I've read and worked through your post on varying system calls and am glad to have another link to it. The system call was a band-aid, because jq can't seem to do anything directly:

$ pwd /home/hogan/Documents/hogan/json_stuff $ ls 1.openapi.json 2.weather.json russian-words.json 1.weather.json countries.geo.json snapshots $ jq '.' 1.openapi.json jq: error: Could not open file 1.openapi.json: Permission denied $

Apparently I used 'snap' to install it:

$ history | grep jq 1376 curl 'https://api.github.com/repos/stedolan/jq/commits?per_page +=5' 1377 jq '.[] | {message: .commit.message, name: .commit.committer.na +me}' 1378 sudo snap install jq

I tried to raise priveleges with:

1429 chmod a+x snap/bin/jq 1430 chmod a+x /snap/bin/jq 1431 sudo chmod a+x /snap/bin/jq

, without success (??)


In reply to Re^4: polishing up a json fetching script for weather data by Aldebaran
in thread polishing up a json fetching script for weather data by Aldebaran

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.