Live data from Hacker News

Marcel the Shell

marceltheshell.org

81–90 of 209 posts

Re: Marcel the Shell

#81
post #78
post #77

Earlier quoted context omitted.

Using the output of find into another program is not safe due to risk of file names containing delimiters. You need to use find -exec. Good example of why machine readable output is important. Agree that the tutorial should showcase more and larger such examples.

You can always use -print0. I suppose there is some risk of a null slipping into a filename but I’ve never come across it myself.

> some risk of a null slipping into a filename

Only in some fairly esoteric environments: https://en.wikipedia.org/wiki/Filename#Comparison_of_filenam...

Re: Marcel the Shell

#82
post #44

I haven't kept up on my Python-flavoured shells. How is this different with xonsh? What similarities does it have with xonsh? Looking for a compare/contrast, not a ranking. Diversity is usually good Kudos to author, this looks really good

Thank you! Integration with Python: Xonsh defines a language that is a superset of Python and shell, as I understand it. Marcel takes a different approach, defining only a bash-like shell language. Any customization is done in Python, delimited by parens. The separation between shell and Python is much stricter. Also, Marcel provides a Python API so that you can write shell-like marcel commands inside of a Python pro…

> Marcel pipes python values in streams

That's indeed much better, all those untyped strings in shells in a bad old design

Though hopefully xonsh will implement this as well https://github.com/xonsh/xonsh/issues/3967

Re: Marcel the Shell

#83
post #77
post #49

Earlier quoted context omitted.

This looks interesting, but the examples don't really show off Marcel's power. The example you just gave without Marcel is: 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…

Using the output of find into another program is not safe due to risk of file names containing delimiters. You need to use find -exec. Good example of why machine readable output is important. Agree that the tutorial should showcase more and larger such examples.

Yes, I know that, but it's also exceedingly rare for a filename to contain a newline and using -exec is extremely inefficient. I also wrote that on my iPad. Typically I'd use a combination of -print0 and xargs -0 for anything more formal than a one-liner on the command line.

The larger bug in my example is that it fails if any of the directories in the path contain a "." in their name!

Re: Marcel the Shell

#84
post #5

How does this compare to nushell? I am in the market to learn something other than bash and right now nushell seems like the best candidate.

I wrote marcel. In my view, nushell and marcel are very similar. nushell has tabular output, which I haven't thought was all that useful. 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 | se…

In that case, is it even more similar to xonsh?

https://xon.sh/

Re: Marcel the Shell

#85
post #46

Earlier quoted context omitted.

That’s really interesting; how do you use powershell in that context? I’m assume it isn’t just Here’s FOIA request for the output of the command find /home/jbiden -name “*secret*doc” haha.

It was most notably helpful in litigation against the White House Office of Management and Budget. Was suing for one week of email metadata records (to, from, CC, bcc, time, date) in the last week of Jan 2017. They said that they had no way to complete the request. So we sent them multiple one liners that extracts the info from outlook 365, which pipes it to a csv export command. They told us that they didn't run tha…

This deserves a thread of its own! Is there any coverage of this case?

Re: Marcel the Shell

#86
First of all - Linuxes and alike desperately need something like this shell becoming standard. And second - I always wonder how all these great minds who where throwing rubbish at Microsoft ever since... somehow forgot to mention that same company created important product called PowerShell like 20 years ago. And you know PowerShell is so good already you can easily drop it in any OS/X, Linux and it actually works. No one, except for Jeffrey Snover figured it out on time, there is great interview here - https://evrone.com/blog/jeffrey-snover-interview.

But for PowerShell to become Python on Perl steroids on top of all the .NET and COM+ there is, well, of course it took years, and top engineers to work on it, but also was needed an unified interface (API) to the underlying OS magic. Which is not there in Linux the same sense .NET became "available". OS/X has something similar to COM+ called CORBA which was left half-baked at best. Python is not .NET, sorry. Not anywhere near.

Someone may say the UNIX ideology is about your programs doing one thing at time, and having this STDIN->munch->STDOUT approach. But these streams never got any structure, and ppl out there been creating great tools to fill this gap, tools such as - jq, mlr, xidel to name a few. perhaps we should include ack, ag and rg in the list.

You know, guys, you hard-loving bash die-hards and sed+awk magicians, you should give this PowerShell thing a try before inventing the wheel again. And before legacies you wrote 20 years ago become as difficult to support as COBOL. Oh yeah, and PoSH is open source, based on open-source runtime, and available in brew/apt/yum...

Disclaimer: I do not work, and have never worked for MS (Guido does now!). Have used DOS since 6.22, FreeBSD since 8th version, Debian since v5, and Windows since v3.1. I did Perl for 20 years, actually I gave Perl classes in some university, still doing fair amount of Python, and accidentally discovered PowerShell 3 years ago. I'm not a .NET advocate, although I can tell the good parts.

Re: Marcel the Shell

#87

Earlier quoted context omitted.

That's not correct. In fact, there was a relatively recent Supreme Court case where a "joke products" maker (I don't remember the exact products, I think they were dog toys or something) basically made them look like Jack Daniels products. They argued it was a spoof, so should be protected. The court ruled against them, saying that even though they were selling in a totally different arena, they were still coasting o…

The Supreme Court case didn't find the dog toy satirizing Jack Daniels was infringing, just that it was possible and a jury should decide rather than the case being dismissed.

Right, the court's holding simply held that a trademark infringement claim concerning the commercial use of a trademark as a trademark was outside the scope of the Rogers threshold test ("the claim must be dismissed unless the complainant can show either (1) that the challenged use of a mark “has no artistic relevance to the underlying work” or (2) that it “explicitly misleads as to the source or the content of the work.”") and is moved directly to the next step which is the Lanham Act's "likelihood of confusion" analysis.

A trademark claim here might not be dismissed under Rogers, but I don't think there is any jury that could ever find that consumers were likely to become confused about whether or not the command line tool Marcel the Shell was affiliated with the independent film cartoon character, and even if that could be established, unlike Jack Daniels, what $$$ damages were caused in trademark dilution? 3 figures?

Re: Marcel the Shell

#88
post #86

First of all - Linuxes and alike desperately need something like this shell becoming standard. And second - I always wonder how all these great minds who where throwing rubbish at Microsoft ever since... somehow forgot to mention that same company created important product called PowerShell like 20 years ago. And you know PowerShell is so good already you can easily drop it in any OS/X, Linux and it actually works. N…

I was immediately thinking powershell. I have been doing some Powershell scripting for building chocolatey packages: it weirdly did not feel like shell though and my muscle memory of POSIX commands fails me on the terminal I guess.

What I was wondering though: can you easily access Powershell data types from python?

Re: Marcel the Shell

#89

Hi, I’m the author of Marcel. If you like it and want to work on it, I can use volunteers, for developing features, debugging, doc, porting, improving the website, you name it.

Surely there is some copyright infringement here?

You’re thinking trademark infringement. IANAL, but I wouldn’t worry about it. Worse comes to worst, you could rename it. That’s what Firefox did.

Re: Marcel the Shell

#90
post #46

Earlier quoted context omitted.

It was most notably helpful in litigation against the White House Office of Management and Budget. Was suing for one week of email metadata records (to, from, CC, bcc, time, date) in the last week of Jan 2017. They said that they had no way to complete the request. So we sent them multiple one liners that extracts the info from outlook 365, which pipes it to a csv export command. They told us that they didn't run tha…

This deserves a thread of its own! Is there any coverage of this case?

I need to write about it ;). We won that case just before the last election and unfortunately other things took priority at the time. But it'll happen. Just first need to write about my IL supreme Court loss...
Post reply on HN