Earlier quoted context omitted.
I haven’t seen a shell script in ages that was missing the shebang. Is this common in some places? I’ve started to write dash scripts because that seems to be reasonably posix and bash on macOS is ancient.
I don’t think I’ve ever seen a script written without the shebang. Btw, you can get around the ancient bash in macOS by installing a more modern bash and invoking with /usr/bin/env bash as your shebang. Not sure if that’s a great idea, mind you, but if you’re already writing scripts in something non-portable, it’s an option.
GitHub – nushell/nushell: A new type of shell
251–260 of 411 posts
Re: GitHub – nushell/nushell: A new type of shell
#252Re: GitHub – nushell/nushell: A new type of shell
#253Earlier quoted context omitted.
Disclaimer: I use PowerShell on Windows, I've never tried it on Linux, but I don't see why its advantages wouldn't transfer. That being said, I think it's main advantages are: - Typed object streams, which gives you stuff like autocomplete, IDE support, and generally there's no need to muck about with sed/awk/xargs - Very fast, it's absolutely fine to read a file line by line, and parse it in a script, whereas doing…
Nice summary. It leaves me wonder, though: is the philosophy the same as in Unix world? as in, little independent tools that do one and just one thing. Would those tools also need to be modified to add compatibility with the same typing system that is used by the shell? Or it follows the opposite mentality and the sell comes with batteries included? I'm thinking of some arbitrary example, like downloading a JSON and…
Re: GitHub – nushell/nushell: A new type of shell
#254Compared to other modern alternatives, NGS is "programming language first".
Repository of scripts written in NGS, aptly named "NGS Scripts Dumpster" - https://github.com/ngs-lang/nsd
Re: GitHub – nushell/nushell: A new type of shell
#255This looks pretty awesome. Wonder if it could be used with a command rather than as a new shell. Tangent: How is this at the top of the front page with a dozen upvotes and no comments? Maybe these upvotes all occurred at once?
Re: GitHub – nushell/nushell: A new type of shell
#256Earlier quoted context omitted.
Am I missing something cool by not looking into PowerShell for Linux? Anyone using it could chime in and share how it improves their workflow? What kind of tools does it bring to the table?
Powershell is a pretty neat scripting language, especially if you manage Windows boxes or have lots of .net stuff around. It's not a good interactive shell environment though. The commands are way too verbose and the syntax feels clunky for keying in.
[0] tab complete works on cmdlets, switches, and variables.
Re: GitHub – nushell/nushell: A new type of shell
#257Earlier quoted context omitted.
PowerShell from Microsoft is looking too alien on Unix. Just looking at the syntax I already feel uncomfortable. It's hard for me to criticize it because I haven't used it, but it looks like it was designed by a committee and overdesigned. I.e. it wasn't created from the need, like someone at Microsoft wanted to automate his work and created PS to solve his problem. It looks like some boss decided: "They have shells,…
PowerShell was started by a single person, Microsoft's Jeffrey Snover. As the project progressed other designers came on board but Snover remained (and remains) as Chief Architect. The design-by-committee allegation isn't being fair to him. Part of why PowerShell may seem not quite Unix-like, is Snover didn't just look at Unix as an influence. Snover's professional background included experience with IBM OS/400's CL…
Re: GitHub – nushell/nushell: A new type of shell
#258Earlier quoted context omitted.
Can you write a bash one-liner that gets the free memory of your system? Is the awk blackmagic better than selecting an item of an object? Of course new things will be harder to write but it’s a people problem not something inherent with PS.
is the writing part really what we should focus on in scripting though? i personally would've put much more weight into the ease of reading and understanding the code. personally, i think that PS just came too late, so most people (me included) are too used to the way the unix shell works/feels. It would have to be just straight up better in all regards to displace it, but its more like a different flavor entirely. I…
Re: GitHub – nushell/nushell: A new type of shell
#259Earlier quoted context omitted.
I just hope that Rust with 40 years of backwards compatibility feels better than C++ today.
40 years is a long time, so the experience will almost certainly degrade a fair bit. The notion of editions in rust makes allowances for breaking changes while still keeping backwards compatibility, I'm very curious to see whether the problems that solves outweigh the complexity in the compiler.
They only work in the ideal case that whole dependencies are available as source code, the same compiler is used for the whole compilation process and for light syntactic changes.
In fact for IntoIterator, a small fix to the editions was made, https://blog.rust-lang.org/2021/05/11/edition-2021.html
With 40 years of history, several Rust compilers in production, corporations shipping binary crates, expect the editions to be as effective as ISO/ECMA language editions.
Re: GitHub – nushell/nushell: A new type of shell
#260I wonder if this could be accomplished in a more general way with a fourth standard file descriptor for structured data. stdjson basically.