1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-03-28 21:16:20 +01:00

less-than: add examples (#15639)

This commit is contained in:
Managor 2025-02-09 09:20:36 +02:00 committed by GitHub
parent c0df7e9877
commit 2cacaaa4e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,3 +14,15 @@
- Create a here string and pass that into `stdin` (achieves the same effect as `echo string |`):
`{{command}} <<< {{string}}`
- Process data from a file and write the output to another file:
`{{command}} < {{path/to/file.txt}} > {{path/to/file2.txt}}`
- Write a here document into a file:
`cat << {{EOF}} > {{path/to/file.txt}} <Enter> {{multiline_data}} <Enter> {{EOF}}`
- Disregard leading tabs (good for scripts with indentation but does not work for spaces):
`cat <<- {{EOF}} > {{path/to/file.txt}} <Enter> {{multiline_data}} <Enter> {{EOF}}`