I’ve been trying nushell and words fail me. It’s like it was made for actual humans to use! 🤯 🤯 🤯
It even repeats the column headers at the end of the table if the output takes more than your screen…
Trying to think of how to do the same thing with awk
/grep
/sort
/whatever
is giving me a headache. Actually just thinking about awk
is giving me a headache. I think I might be allergic.
I’m really curious, what’s your favorite shell? Have you tried other shells than your distro’s default one? Are you an awk wizard or do you run away very fast whenever it’s mentioned?
I’ve been using fish (with starship for prompt) for like a year I think, after having had a self-built zsh setup for … I don’t know how long.
I’m capable of using
awk
but in a very simple way; I generally prefer being able to usejq
. IMO both awk and perl are sort of remnants of the age before JSON became the standard text-based structured data format. We used to have to write a lot of dinky little regex-based parsers in Perl to extract data. These days we likely get JSON and can operate on actual data structures.I tried
nu
very briefly but I’m just too used to POSIX-ish shells to bother switching to another model. For scripting I’ll use#!/bin/bash
withset -eou pipefail
but very quickly switch to Python if it looks like it’s going to have any sort of serious logic.My impression is that there’s likely more of us that’d like a less wibbly-wobbly, better shell language for scripting purposes, but that efforts into designing such a language very quickly goes in the direction of nu and oil and whatnot.
nu
's commands also work on JSON, so you don’t really need jq (or xq or yq) any more. It offers a unified set of commands that’ll work on almost any kind of structured data.That’s interesting I hadn’t thought about the JSON angle! Do you mean that you can actually use
jq
on regular command outputs likels -l
?Oil is an interesting project and the backward compatibility with bash is very neat! I don’t see myself using it though, since it’s syntax is very close to bash on purpose I’d probably get oil syntax and bash syntax all mixed up in my head and forget which is which… So I went with nushell because it doesn’t look anything like bash. If you know python what do you think about xonsh? I
No, you need to be using a tool which has json output as an option. These are becoming more common, but I think still rare among the GNU coreutils.
ls
output especially is unparseable, as in, there are tons of resources telling people not to do it because it’s pretty much guaranteed to break.There’s jc (CLI tool and python library that converts the output of popular command-line tools, file-types, and common strings to JSON, YAML, or Dictionaries).