mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-15 04:59:56 +00:00
Update cheatsheets
This commit is contained in:
32
tldr/print
Normal file
32
tldr/print
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# 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
|
||||
Line2"`
|
||||
|
||||
- Print arguments as described by 'printf' (for greater portability across shells, consider instead the `printf` command):
|
||||
|
||||
`print -f "%s is %d years old.
|
||||
" "Alice" 30`
|
||||
Reference in New Issue
Block a user