Home Explore Blog CI



nushell

2nd chunk of `blog/2020-04-21-nushell_0_13_0.md`
7d5131467b7a3fad1c01d833ba6db9acf26351ce21ab46b90000000100000989
In Bash, you might do something like this:

```
> make && ./run/my/app
```

If make succeeds, then your app runs. We're introducing the ';' separator which does this (beware bash users that this ';' will stop if the left-hand fails). You can write the above bash line as this in Nu 0.13.0:

```
> make; ./run/my/app
```

Note that commands that you may be used to printing to the terminal when you run them directly may not print anything when used on the left-hand side of the `;`. This is because the data comes out and, being structured, it just gets consumed before it's viewed. If you prefer to see the output of a command on the left of the `;`, you can pass it through `autoview` to do this for you:

```
> ls | autoview ; echo "done"
```

## Math operations (sophiajt)

Wish you had a calculator or want to do a quick computation on something in your table? With 0.13.0, you can now switch into "math mode" and do a quick calculation. To switch into math mode, use the `=` operator as the command name.

```
> = 3 + 4
7
```

You can use this in pipelines as well, do something like:

```
ls | get size | = $it + 1mb
```

It doesn't end there. Not only are the basic +, -, \*, and / available, but you can use these new operators:

### checking if a value is in a member of the given table with `in:`

```
> = a in: [a b c]
true
> = d in: [a b c]
false
```

### `&&` and `||` to create compound comparisons

```
> ls | where name > 'f' && size > 1kb
```

### Parens to allow grouping

```
= (1 + 2) * (3 + 4)
21
```

## New parser logic (sophiajt)

Early in this release cycle, we began experimenting with different ways we could write the parser going forward. Being able to parse commands, where each command could dictate how the parser works for that command, is a special challenge of how Nu works. After a bit of experimenting, we found a way forward that quickly seemed to fix some of the long-standing bugs. Not only this, but it opened up the way for a set of new features.

If you find issues with this new parser logic where code that used to work no longer works, please let us know. This will help us work out any issues as we build new features on it.

## External improvements (thegedge, sophiajt)

With 0.13.0, we're taking a big step to making externals work in a way much more in-line with how internals work. This allows us to provide better support for variables, column paths, coloring, error handling, and more.

Title: Nushell 0.13.0: Semicolon Support, Math Operations, and Parser Improvements
Summary
Nushell 0.13.0 introduces semicolon support for composing pipelines, allowing users to execute commands sequentially. It also adds a 'math mode' using the '=' operator for quick calculations, including operators like '+', '-', '*', '/', 'in:', '&&', and '||'. The release includes a new parser logic aimed at fixing bugs and enabling new features. Additionally, external commands are improved to work more like internal commands, enhancing variable support, column paths, coloring, and error handling.