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:
skykasko 2024-08-24 01:03:59 -04:00 committed by GitHub
parent f7835243c5
commit 8ca64de67e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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!")