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:
@@ -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!")
|
||||
|
||||
Reference in New Issue
Block a user