2024-10-01 20:20:05 +03:00
|
|
|
# Less than
|
|
|
|
|
2024-10-12 08:01:56 +03:00
|
|
|
> Redirect data to `stdin`.
|
2024-10-01 20:20:05 +03:00
|
|
|
> More information: <https://gnu.org/software/bash/manual/bash.html#Redirecting-Input>.
|
|
|
|
|
2024-10-12 08:01:56 +03:00
|
|
|
- Redirect a file to `stdin` (achieves the same effect as `cat file.txt |`):
|
2024-10-01 20:20:05 +03:00
|
|
|
|
|
|
|
`{{command}} < {{path/to/file.txt}}`
|
2024-10-12 08:01:56 +03:00
|
|
|
|
|
|
|
- Create a here document and pass that into `stdin` (requires a multiline command):
|
|
|
|
|
|
|
|
`{{command}} << {{EOF}} <Enter> {{multiline_data}} <Enter> {{EOF}}`
|
|
|
|
|
2024-10-16 10:04:14 +03:00
|
|
|
- Create a here string and pass that into `stdin` (achieves the same effect as `echo string |`):
|
2024-10-12 08:01:56 +03:00
|
|
|
|
|
|
|
`{{command}} <<< {{string}}`
|