Spec-Zone.ru › Nushell

tee for filters

Copy a stream to another command in parallel.

Signature

> tee {flags} (closure)

Flags

  • --stderr, -e: For external commands: copy the standard error stream instead.

Parameters

  • closure: The other command to send the stream to.

Input/output types:

input output
any any

Examples

Save a webpage to a file while also printing it.

> http get http://example.org/ | tee { save example.html }

Save error messages from an external command to a file without redirecting them.

> nu -c 'print -e error; print ok' | tee --stderr { save error.log } | complete

Print numbers and their sum.

> 1..100 | tee { each { print } } | math sum | wrap sum

Do something with a value on another thread, while also passing through the value.

> 10000 | tee { 1..$in | print } | $in * 5
50000

Notes

This is useful for doing something else with a stream while still continuing to use it in your pipeline.

Copyright © 2019–2026 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/tee.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API