4 ms·
Here’s one for HN readers, you can now find jq in /usr/bin/ in Sequoia.
by krelas 2y ago
Here’s one for HN readers, you can now find jq in /usr/bin/ in Sequoia.
- subjectsigma 2y agoWhoa, you're right. How did you know? The developer notes only seem to talk about API changes
- krelas 2y agoI manage a lot of Macs, been beta testing since June.
- andrelaszlo 2y agoIs it the BSD jq from 1995? </s> Jk, thanks for the info! It's nice to know it's available on the system by default when writing scripts for my team.
- wpm 2y agoNah just the last GPL2 licensed version from 2008 ope wait that's just bash
- vbezhenar 2y agoNow that's the real feature!
- switch007 2y ago$ jq '.[] | messages | .thank_you' < strings.json wait, maybe it's... $ jq '. | .messages.thank_you' < strings.json darn it! how about $ jq '[].messages.thank_you' < strings.json !??@@!
- LeoPanthera 2y agoFiguring out what garbage to type into jq is the best thing about ChatGPT.
- benkuykendall 2y agoFor some reason, I find it kinda funny you don't just ask the LLM to extract the values for you. Practically, your solution makes a lot of sense -- way fewer tokens, less likely to make weird one-off errors, can verify the response makes basic sense or re-use the code off-line or with sensitive data... But if I were watching Star Trek, they would definitely just ask the computer to grab the fields and it would be a done deal!
- LeoPanthera 2y agoI'm rarely just using jq once. It's almost always going into a script, often where I only have placeholder data to test it with. Plus, you know, I actually learn how jq works and will need to ask the Magic Sky Oracle less often, in the future.
- pxc 2y ago> Plus, you know, I actually learn how jq works What's wrong with the docs? Relatedly, do you actually look up every filter and argument used in your AI-generated sample code in the jq docs?
- deleted 2y ago[deleted]
- gcr 2y agojq's syntax is different, but well worth remembering. i have some flash cards if you'd like. a teensy amount of effort pays huge dividends with swiss knife software like this (and things like matplotlib, tar CLI options, etc)
- throwitaway1123 2y agoWow, that might be the best part of the update. System Integrity Protection shields /usr, /bin, and /sbin, so I prefer to use the system provided executables in those directories when possible.
- jxy 2y agointeresting % /usr/bin/jq --version jq-1.6-159-apple-gcff5336-dirty
- shawn_w 2y ago1.6? Wonder why they went with an outdated version.
- krelas 2y agoIf you think this is bad then don’t check the version of bash it ships with.
- mdaniel 2y agoI can't know what "-dirty" implies, but https://github.com/jqlang/jq/commit/cff5336 https://github.com/jqlang/jq/commit/cff5336 is a pretty random commit from 2022 :-( https://github.com/apple-oss-distributions/distribution-macOS/tree/rel/macOS-14 https://github.com/apple-oss-distributions/distribution-macO... hasn't been updated with a "jq" directory yet
- int_19h 2y ago"dirty" usually means that the commit doesn't correspond to any specific version tag in the repo (or whatever other mechanism is used to map commits to versions).
- mdaniel 2y agoIncorrect: https://git-scm.com/docs/git-describe#Documentation/git-describe.txt---dirtyltmarkgt https://git-scm.com/docs/git-describe#Documentation/git-desc... > If the working tree has local modification "-dirty" is appended to it. and one can see their invocation of --dirty here: https://github.com/jqlang/jq/blob/cff5336ec71b6fee396a95bb0e4bea365e0cd1e8/configure.ac#L4 https://github.com/jqlang/jq/blob/cff5336ec71b6fee396a95bb0e...