mirror of
https://github.com/astral-sh/uv.git
synced 2025-12-23 09:19:48 +00:00
Add example of reading script from stdin using echo (#6567)
As a non-shell-wizard, I was unfamiliar with the `EOF` syntax used in the existing example (just above the one I added). I thought including an example where the output of `echo` is piped to `uv run` might be more accessible. As a bonus, it should work across more shells: the `EOF` example doesn't work in fish because fish [doesn't support heredocs](https://fishshell.com/docs/current/fish_for_bash_users.html#heredocs), while the `echo` example does. Feel free to ignore if unwanted.
This commit is contained in:
parent
f7835243c5
commit
8ca64de67e
1 changed files with 6 additions and 0 deletions
|
|
@ -57,6 +57,12 @@ hello world!
|
|||
|
||||
Additionally, your script can be read directly from stdin:
|
||||
|
||||
```console
|
||||
$ echo 'print("hello world!")' | uv run -
|
||||
```
|
||||
|
||||
Or, if your shell supports [here-documents](https://en.wikipedia.org/wiki/Here_document):
|
||||
|
||||
```bash
|
||||
uv run - <<EOF
|
||||
print("hello world!")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue