diff --git a/docs/tutorial.rst b/docs/tutorial.rst index cd749d19d..c57b262c1 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -502,6 +502,12 @@ result is automatically converted to a string. For example, 42 yo >>> echo "hello" | @(lambda a, s=None: s.read().strip() + " world\n") hello world + >>> @(['echo', 'hello world']) + hello world + +.. warning:: + If the expression is a string and not a list then it will be passed to the + subprocess as a single argument. This syntax can be used inside of a captured or uncaptured subprocess, and can be used to generate any of the tokens in the subprocess command list. diff --git a/news/doc_at_cmd.rst b/news/doc_at_cmd.rst new file mode 100644 index 000000000..348e4726e --- /dev/null +++ b/news/doc_at_cmd.rst @@ -0,0 +1,14 @@ +**Added:** + +* Docs for using ``@()`` as a way to run commands and a gotcha about + list of strings vs single string expressions. + +**Changed:** None + +**Deprecated:** None + +**Removed:** None + +**Fixed:** None + +**Security:** None