1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 01:02:09 +02:00

<: add here strings and documents (#13988)

This commit is contained in:
Managor 2024-10-12 08:01:56 +03:00 committed by GitHub
parent 920beabe26
commit e0cf59ef9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,9 +1,16 @@
# Less than
> Redirect a file to `stdin`.
> Achieves the same effect as `cat file.txt |`.
> Redirect data to `stdin`.
> More information: <https://gnu.org/software/bash/manual/bash.html#Redirecting-Input>.
- Redirect a file to `stdin`:
- Redirect a file to `stdin` (achieves the same effect as `cat file.txt |`):
`{{command}} < {{path/to/file.txt}}`
- Create a here document and pass that into `stdin` (requires a multiline command):
`{{command}} << {{EOF}} <Enter> {{multiline_data}} <Enter> {{EOF}}`
- Create a here string and pass that into `stdin`:
`{{command}} <<< {{string}}`