diff --git a/pages/common/print.md b/pages/common/print.md new file mode 100644 index 00000000000000..85fb55a4b6c679 --- /dev/null +++ b/pages/common/print.md @@ -0,0 +1,25 @@ +# print + +> Z Shell (`zsh`) builtin. Prints arguments, similar to `echo`. +> See also: `echo`, `printf`, `zsh`. +> More information: . + +- 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' (for greater portability across shells, consider instead the `printf` command): + +`print -f "%s is %d years old.\n" "Alice" 30`