W3cubDocs

/Nushell

print for strings

Print the given values to stdout.

Signature

> print {flags} ...rest

Flags

  • --no-newline, -n: print without inserting a newline for the line ending
  • --stderr, -e: print to stderr instead of stdout

Parameters

  • ...rest: the values to print

Input/output types:

input output
any nothing
nothing nothing

Examples

Print 'hello world'

>print"hello world"

Print the sum of 2 and 3

>print (2+3)

Notes

Unlike echo, this command does not return any value (print | describe will return "nothing"). Since this command has no output, there is no point in piping it with other commands.

print may be used inside blocks of code (e.g.: hooks) to display text during execution without interfering with the pipeline.

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