nushell/docs/commands/default.md

29 lines
467 B
Markdown
Raw Normal View History

---
title: default
layout: command
version: 0.59.1
---
2019-12-01 17:39:09 +01:00
Sets a default row's column if missing.
2019-12-01 17:39:09 +01:00
## Signature
```> default (default value) (column name)```
2019-12-01 17:39:09 +01:00
## Parameters
2019-12-01 17:39:09 +01:00
- `default value`: the value to use as a default
- `column name`: the name of the column
2019-12-01 17:39:09 +01:00
## Examples
2019-12-01 17:39:09 +01:00
Give a default 'target' column to all file entries
2019-12-01 17:39:09 +01:00
```shell
> ls -la | default 'nothing' target
```
Default the `$nothing` value in a list
```shell
> [1, 2, $nothing, 4] | default 3
2019-12-01 17:39:09 +01:00
```