Skip to content

Commit

Permalink
Fixed some examples for Command Output in Nushell
Browse files Browse the repository at this point in the history
  • Loading branch information
subaio-daniel-petersen committed Dec 18, 2024
1 parent 58df050 commit 7ffee65
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions book/pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,13 +470,13 @@ In fact, running this in the shell will only display `"What?!"` because that is
Knowing when data is displayed is important when using configuration variables that affect the display output of commands such as `table`.

```nu
> do { $env.config.table.mode = none; ls }
> do { $env.config.table.mode = "none"; ls }
```

For instance, the above example sets the `$env.config.table.mode` configuration variable to `none`, which causes the `table` command to render data without additional borders. However, as it was shown earlier, the command is effectively equivalent to

```nu
> do { $env.config.table.mode = none; ls } | table
> do { $env.config.table.mode = "none"; ls } | table
```

Because Nushell `$env` variables are [scoped](https://www.nushell.sh/book/environment.html#scoping), this means that the `table` command in the example is not affected by the
Expand All @@ -485,6 +485,6 @@ environment modification inside the `do` block and the data will not be shown wi
When displaying data early is desired, it is possible to explicitly apply `| table` inside the scope, or use the `print` command.

```nu
> do { $env.config.table.mode = none; ls | table }
> do { $env.config.table.mode = none; print (ls) }
> do { $env.config.table.mode = "none"; ls | table }
> do { $env.config.table.mode = "none"; print (ls) }
```

0 comments on commit 7ffee65

Please sign in to comment.