> In a nutshell, nushell is non-POSIX shell, so most of your regular shells knowledge (zsh, bash, ksh, etc…) can't be applied on it, and using it feels like doing functional programming. Is there a reason some shells like fish (and now nushell) are non-POSIX? What is the benefit? I really like fish but I've kept away from it because it's non-POSIX and won't necessarily play well with years of POSIX scripts and knowle…
Is there a reason some shells like fish (and now nushell) are non-POSIX? Some things are different than other things. It's the same reason that not all desserts are pie, and not all automobiles are trucks.
Nushell: Introduction to a new kind of shell
71–80 of 252 posts
Re: Nushell: Introduction to a new kind of shell
#72One issue I have with nushell is that on macOS they use the `Library/Application Support` path for the config instead of the `.config` making it awkward, their reason is that the former is the correct path of application data, while none of the other CLI apps I use do this, every other app just points to the `$HOME` dir or `.config` dir. I used it for a while but I switched back to zsh, maybe in the future when it ha…
surely something as basic as the location of the config folder can somehow be changed to a custom path, right?
But you can certainly create your own symlink.
Re: Nushell: Introduction to a new kind of shell
#73>This is just an example from YAML to JSON, but you can convert much more formats into other formats. >open dev/home-impermanence/tests/impermanence.yml | to json I can do it with PowerShell: $os_list = (Get-Content -Path "C:\temp\operating-systems.yml" | ConvertFrom-Yaml) Set-Content -Path "C:\temp\PowerShell_operating-systems.json" -Value ($os_list | ConvertTo-Json)
That is a great example, but for different reasons. I think PowerShell is amazing, but it never feels like something I want to work in as a shell. Writing scripts in an IDE, sure. But to convert some yaml to json I’d much rather type open/file.yml | to json
The caveat of course is Windows system administration. I’m sure it’s excellent in that domain.
Re: Nushell: Introduction to a new kind of shell
#74Re: Nushell: Introduction to a new kind of shell
#75>This is just an example from YAML to JSON, but you can convert much more formats into other formats. >open dev/home-impermanence/tests/impermanence.yml | to json I can do it with PowerShell: $os_list = (Get-Content -Path "C:\temp\operating-systems.yml" | ConvertFrom-Yaml) Set-Content -Path "C:\temp\PowerShell_operating-systems.json" -Value ($os_list | ConvertTo-Json)
That is a great example, but for different reasons. I think PowerShell is amazing, but it never feels like something I want to work in as a shell. Writing scripts in an IDE, sure. But to convert some yaml to json I’d much rather type open/file.yml | to json
Re: Nushell: Introduction to a new kind of shell
#76Earlier quoted context omitted.
> PowerShell's huge deviance from the rest of the POSIX-y world doesn't help In PowerShell (on Windows), `rm` is an alias to `Remove-Item`[0]. Therefore, rm -r -fo An extra dash, extra space, and extra letter isn't too bad by my books. Furthermore, in scripts, aliases are discouraged by PSScriptAnalyzer[1]; IDEs (PowerShell ISE, VS Code PowerShell extension) also support code completion, so: Remove-Item -Recurse -For…
When PS has pushd, popd and dirs -v I’ll switch.
Re: Nushell: Introduction to a new kind of shell
#77Earlier quoted context omitted.
> anti-semantic Why? > non-portable PowerShell 6 and later run on Windows, macOS, and Linux. > verbose This is by design.
>Why? Case insensitive, weird parameter passing, no Posix-like interface. >Windows, macOS, and Linux Yet it is still mostly suitable for Windows, where it makes sense with weird (read: mostly bad and outdated) platform-wide proprietary decisions. >This is by design Well, humans should not spend too much focus on verbosity, maybe I'm wrong, at least that's what I've learnt from a university HCI course.
Parameters are passed like any other shell?
> Well, humans should not spend too much focus on verbosity, maybe I'm wrong, at least that's what I've learnt from a university HCI course.
While its by design everything comes aliased and arguments are fuzzy matched. As a human you don't need to spend time on verbosity if you don't want to.
For example:
Remove-Item $directory -Recurse -Force
rm $directory -r -foRe: Nushell: Introduction to a new kind of shell
#78>This is just an example from YAML to JSON, but you can convert much more formats into other formats. >open dev/home-impermanence/tests/impermanence.yml | to json I can do it with PowerShell: $os_list = (Get-Content -Path "C:\temp\operating-systems.yml" | ConvertFrom-Yaml) Set-Content -Path "C:\temp\PowerShell_operating-systems.json" -Value ($os_list | ConvertTo-Json)
That is a great example, but for different reasons. I think PowerShell is amazing, but it never feels like something I want to work in as a shell. Writing scripts in an IDE, sure. But to convert some yaml to json I’d much rather type open/file.yml | to json
For example:
Remove-Item $directory -Recurse -Force
rm $directory -r -fo
For this specific example ConvertFrom-Yaml actually doesn't exist as a standard cmdlet and ConvertTo-Json isn't aliased by default: gc ./something.yml | ConvertFrom-Yaml | ConvertTo-Json > /some/file.jsonRe: Nushell: Introduction to a new kind of shell
#79>This is just an example from YAML to JSON, but you can convert much more formats into other formats. >open dev/home-impermanence/tests/impermanence.yml | to json I can do it with PowerShell: $os_list = (Get-Content -Path "C:\temp\operating-systems.yml" | ConvertFrom-Yaml) Set-Content -Path "C:\temp\PowerShell_operating-systems.json" -Value ($os_list | ConvertTo-Json)
$ brew install yq
$ yq -o json . Re: Nushell: Introduction to a new kind of shell
#80Earlier quoted context omitted.
It's literally a subsystem. It's integrated in many ways you would not use to describe a "VM". I don't understand the aversion nor the confusion.
Here’s an example: if I build a Python app with PyInsyaller (which can’t cross-compile), and if I want a Windows executable, I have to build on Windows, not WSL, which defeats the whole purpose of “bash on Windows” because now at best I have to use Cygwin or Powershell or something and deal with a completely different environment.
OTOH, if you are doing anything complicated, it gets weird because (e.g.) file paths have to be passed as windows paths to windows programs, not using the linux mount path that you would access the path from in linux. But, you can, in principle, use a Linux shell in WSL to run Windows PyInstaller to build for Windows.