Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print: add page #15597

Merged
merged 11 commits into from
Feb 11, 2025
25 changes: 25 additions & 0 deletions pages/common/print.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# print

> Z Shell (`zsh`) builtin. Prints arguments, similar to `echo`.
> See also: `echo`, `printf`, `zsh`.
> More information: <https://zsh.sourceforge.io/Doc/Release/Shell-Builtin-Commands.html>.

- Print input:

`print "Hello" "World"`

- Print separated by newline(s):

`print -l "Linel" "Line 2" "Line3"`

- Print without trailing newline:

`print -n "Hello"; print "World"`

- Enable backslash escapes:

`print -e "Line 1\nLine2"`

- Print arguments as described by 'printf'. Note: For greater portability across shells use `printf`:
Managor marked this conversation as resolved.
Show resolved Hide resolved

`print -f "%s is %d years old.\n" "Alice" 30`
Loading