1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-08 13:55:24 +02:00
tldr/pages/common/less-than.md
2024-10-12 10:31:56 +05:30

16 lines
481 B
Markdown

# Less than
> Redirect data to `stdin`.
> More information: <https://gnu.org/software/bash/manual/bash.html#Redirecting-Input>.
- 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}}`