For those of you unaware: https://nushell.sh/

This is by far the most unique shell out there, since it doesn’t use raw text as output/input to command line calls, but instead an actual data structure. It’s like if every CLI call returned a database table, in a way.

  • @brian@programming.dev
    link
    fedilink
    73 days ago

    worst case you’re parsing command output like you would in bash, so you’re not really worse off. I’ve got a handful of aliases that wrap commands I run often so I only dealt with parsing in the beginning. there are enough builtins that output structured data, or applications that have a json flag that it’s still useful.

    speaking of powershell, it’s easy enough in nushell to write an alias that shells out to pwsh and calls ConvertTo-Json then from json on the nu side. that gives you plenty of extra commands that are structured, at least on windows

    • @mormund@feddit.org
      link
      fedilink
      43 days ago

      Why not just use Powershell then? It’s been available for Linux for a long time. I use it for scripting quite often

      • @brian@programming.dev
        link
        fedilink
        43 days ago

        bc nu does everything pwsh does, but without the odd and verbose syntax. their exceptions and error codes are two different systems and don’t make sense by default. instead of making shell cmds easy to parse I find myself having to use dotnet versions of things, which would be fine if the syntax for that wasn’t so terrible. nu still feels like a unix shell for the most part.

        pwsh has its place, especially since it’s default. I’ve written plenty of pwsh scripts at work for ci and the like. I can get over the verbose naming in a text editor. using it from a repl isn’t my favorite experience

      • @Kissaki@programming.dev
        link
        fedilink
        English
        22 days ago

        I always had an aversion to PowerShell syntax.

        They’re certainly both object shells. If you’re already familiar with PowerShell, there’s probably no reason or need to switch. I’m not familiar with PowerShell enough to identify where else they differ.