Marcel is python-based. The nushell guys have had to invent a lot of language. By basing marcel on python, I don't have to invent language. Any logic to be added is expressed in python. E.g, do a recursive listing of files and find those that changed in the last 3 days:
ls -fr | select (f: now() - f.mtime() <= days(3))
The stuff inside the parens is a python function, applied to a File f, piped in from ls. (Marcel lets you omit "lambda".)Lots of marcel examples here: https://marceltheshell.org
sorry couldn't resist.
:)
OK, enough!
( ´ー`) (  ̄ー ̄)ノ
find . -type f -mtime -3
The example on this page: https://www.marceltheshell.org/list-processes ps -u djt | map (p: p.signal(9))
That's: pkill -9 -u djt
The example for summing files by extension is a bit more interesting: ls -fr | map (f: (f.suffix, 1)) | red. + | sort
Vs something like: find . -type f | awk -F. '(NF>1){print "."$NF}; (NF==1){print ""}' | sort | uniq -c
That said, every time I look into one of these shells, I end up sticking with bash. When it gets to the point that I need something more powerful than bash and the Unix command line environment, I'd just as soon write a stand-alone program which I can check into version control, use on remote systems that don't have one of these fancy shells installed, add proper tests, etc.This is a neat project though. I'll keep an eye on it.
As for a more complex example: yes, the website has better examples, but they are also more involved to explain.
Good example of why machine readable output is important. Agree that the tutorial should showcase more and larger such examples.
Only in some fairly esoteric environments: https://en.wikipedia.org/wiki/Filename#Comparison_of_filenam...
The larger bug in my example is that it fails if any of the directories in the path contain a "." in their name!
As someone who's leaned into Nushell deeply, I can tell you that the tabular and hierarchical data output is the major selling point of Nushell. For me and my team, who work with data and metadata constantly, it's an incredible productivity boost.
The major pains with Nushell are debugging pipelines that are too slow, having to learn the new language constructs, and process overhead for going in and out of Python for other pieces.
Can you expand on your first point? Why are tabular and hierarchical output so important for your work?
Been able to give poweshell commands in FOIA litigation and its power is on full display with one liners where it's hard for a gov agency to say no to something so simple.
Here’s FOIA request for the output of the command
find /home/jbiden -name “*secret*doc”
haha.
White House: We can’t do that.
Litigator: Can’t or won’t?
White House: either!
https://mchap.io/that-time-the-city-of-seattle-accidentally-...