Skip to content

Commit 1da297d

Browse files
authored
Fix and clarify explanation of semicolon behavior in pipelines
The behavior previously described was incorrect; it should follow a single return value as the example itself is a single contained expression.
1 parent 3a25711 commit 1da297d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

book/pipelines.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ line1; line2 | line3
4545

4646
Here, semicolons are used in conjunction with pipelines. When a semicolon is used, no output data is produced to be piped. As such, the `$in` variable will not work when used immediately after the semicolon.
4747

48-
- As there is a semicolon after `line1`, the command will run to completion and get displayed on the screen.
49-
- `line2` | `line3` is a normal pipeline. It runs, and its contents are displayed after `line1`'s contents.
48+
- As there is a semicolon after `line1`, the command will run to completion and its output discarded.
49+
- `line2` | `line3` is a normal pipeline. It runs, and as it is the final value, its contents are returned and displayed.
50+
51+
See: [Thinking in Nu -> Single Return Value per Expression](thinking_in_nu.html#single-return-value-per-expression)
5052

5153
## Pipeline Input and the Special `$in` Variable
5254

0 commit comments

Comments
 (0)