mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 16:34:47 +01:00
DOC: single string vs. list of strings in `@()
`
This commit is contained in:
parent
abf1e9cc2c
commit
c357cb2894
2 changed files with 20 additions and 0 deletions
|
@ -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.
|
||||
|
|
14
news/doc_at_cmd.rst
Normal file
14
news/doc_at_cmd.rst
Normal file
|
@ -0,0 +1,14 @@
|
|||
**Added:**
|
||||
|
||||
* Docs for using ``@(<expr>)`` 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
|
Loading…
Add table
Reference in a new issue