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:
parent
920beabe26
commit
e0cf59ef9a
1 changed files with 10 additions and 3 deletions
|
@ -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}}`
|
||||
|
|
Loading…
Add table
Reference in a new issue