New nushell shell introduced

Published first release of the command shell nushell, which combines the capabilities of Power Shell and the classic unix shell. The code is written in Rust and spreads under the MIT license. The project is initially developed as a cross-platform project and supports work on Windows, macOS and Linux. To expand the functionality can be used plugins, interaction with which is carried out via the JSON-RPC protocol.

The shell uses the pipeline system familiar to Unix users in the format "command|filters|output handler". By default, the output is formatted using the autoview command, which uses a table format, but it is also possible to use commands to display binary data and information in a tree view. The strength of nushell is its ability to manipulate structured data.

The shell allows you to structure the output of various commands and the contents of files, and apply arbitrary filters that are formatted using a unified syntax that does not require learning the command line options of each particular command. For example, nushell allows constructs such as "ls | where size > 10kb" and "ps | where cpu > 10", which will result in the output of only files larger than 10Kb and processes that have spent more than 10 seconds of CPU resources:

New nushell shell introduced

New nushell shell introduced

To structure the data, a number of add-ons are used that parse the output of specific commands and file types. Similar add-ons are offered for the cd, ls, ps, cp, mkdir, mv, date, rm commands (the "^" prefix can be used to call native commands, for example, calling "^ls" will launch the ls system utility). There are also specialized commands such as open to display information about the selected file in a table. JSON, TOML, and YAML formats support automatic parsing.

/home/jonathan/Source/nushell(master)> open Cargo.toml

——————+——————+——————
dependencies | dev dependencies | package
——————+——————+——————
[object object] | [object object] | [object Object] ——————+——————+——————

/home/jonathan/Source/nushell(master)> open Cargo.toml | get package

————-+—————————-+———+———+——+———
authors | description | edition | license | name | version
————-+—————————-+———+———+——+———
[list list] | A shell for the GitHub era | 2018 | MIT | nu | 0.2.0
————-+—————————-+———+———+——+———

/home/jonathan/Source/nushell(master)> open Cargo.toml | get package.version | echo $it

0.2.0

A large set of instructions is provided for filtering structured data, allowing you to filter rows, sort by columns, sum data, perform simple calculations, use value counters, convert output to CSV, JSON, TOML and YAML formats. For unstructured data (text), instructions are provided for splitting into columns and rows based on delimiter characters.

Source: opennet.ru

Add a comment