Follow us
Breaking
Software

Nushell replaces the gap between Bash and PowerShell

Nushell provides a structured data approach that bridges the gap between text-based Bash and the heavy verbosity of PowerShell. It allows users to filter information using property names instead of relying on regular expressions or complex .NET implementations.

Share

Nushell provides the structured data approach of PowerShell without the heavy syntax or the platform limitations that prevent widespread Linux adoption. I find that users who struggle with parsing text in Bash or managing the verbosity of PowerShell find a middle ground here. While Bash handles text via pipes and PowerShell handles objects through its .NET implementation, Nushell treats everything as structured data. This approach lets you filter information using property names instead of the regular expressions or column positions required by tools like awk, sed, or cut.

Feature PowerShell Bash
Primary Input/Output Objects Text structures
Native OS Windows Linux
Command Syntax Verb-noun convention Simple text-based
Scripting Ease High Low

Bash remains the default for Linux and macOS, offering fast starting times and simple syntaxes. You can run Bash on Windows using the Windows Subsystem for Linux (WSL) to interact with Windows as if you were on a native Linux machine. PowerShell, introduced in 2006, functions as both a management tool and a scripting language, and it works on Linux and macOS too. It uses a verb-noun naming convention that helps you find related commands through built-in documentation. However, Linux teams rarely adopt PowerShell because they possess deep expertise in Bash and established toolchains. One developer found that returning to Linux meant losing the ability to manipulate data as structured objects without using third-party tools like jc or jq.

The struggle with text parsing and configuration

Bash users often spend time trying to make their shells look better with tools like oh-my-zsh or powerlevel10k. Many plugins for these shells use a Bash dialect, which limits how much they actually change the experience. A user who spent four years on Bash and five years on zsh noted that these modifications feel like "Jing Ji Shang De Xiao Qian " or "economy of matches" when using specific git or composer plugins. These users can use zsh-autocomplete or zsh-autosuggestions to improve their workflow, but the underlying logic remains text-based. For instance, the zsh-lazyload tool helps reduce lag when loading completions for kubectl, but it does not change how the shell processes data.

PowerShell handles automation through a consistent API and an extended typing system. It makes task automation easy because it treats command outputs as objects with named properties. If you want to list files, you use Get-ChildItem, whereas Bash users use ls. To create a file, PowerShell uses New-Item <filename.txt> while Bash uses touch <filename.txt>. If you need to move a line, PowerShell uses Move-Item, but Bash requires mv. You can compare these basic commands to see how the syntax differs.

Task PowerShell Command Bash Command
List Files Get-ChildItem ls
Create File New-Item <file.txt> touch <file.txt>
Copy File Copy-Item cp
Move File Move-Item mv
Delete File Remove-Item rm
Delete Directory Remove-Item rm -r
Change Directory Set-Location cd
Current Directory Get-Location pwd
Clear Screen Clear clear
Print String Write-Host echo

You might find that PowerShell scripting feels more pleasant because the syntax resembles other scripting languages. Bash works well for simple tasks and provides robust job control. If you work in a Windows-centric environment with Active Directory or SQL, PowerShell is the logical choice. If you manage Linux servers, Bash is the standard.

Why structured data wins

Nushell allows you to notice "this-needs-more-structure" type problems that text-based shells hide. It provides a way to work with structured output that lets you rewire how you think about data. One user noted that they "un-bashed" their life by moving to Nushell to gain the benefits of structure. This movement offers a way to avoid the "vendor-specific kinds of plugs" that occur when different tools try to talk to each other.

The Unix philosophy relies on the idea that everything is bits, which allows you to join things together easily. However, PowerShell’s reliance on .NET means its Extract-Archive cmdlet cannot handle all the edge cases that traditional tools like tar or zip manage. This creates a gap where PowerShell is powerful for Windows but lacks the universal portability of POSIX shells. POSIX shells like bash, dash, and zsh can run on everything from a "potato to a T-1000" because they are always available.

Some developers prefer Python because it exists on many systems, but Python does not run all programs reliably due to semver changes and pip mutating global system states. This makes it a poor replacement for a universal shell. Nushell tries to bridge this by offering a structured approach that remains less verbose than PowerShell. It provides the benefits of structured data without the high barrier to entry found when trying to evangelize PowerShell to Unix teams.

How do we build an OS that uses structured data for every pipe negotiation? I recommend Nushell for anyone who wants to stop fighting text parsing and start using the data properties they actually need.

Share

Technewsdaily

Senior tech writer covering AI, gadgets and cybersecurity. Breaking down the news that matters, every day.