Replace backquote with command substitution in subprocess doc example (GH-13941)

Replace backquotes with POSIXy command substitution in example.
This commit is contained in:
David Jones 2019-07-16 15:55:19 +01:00 committed by Gregory P. Smith
parent e8692818af
commit 6a61714cde
2 changed files with 5 additions and 7 deletions

View File

@ -1166,12 +1166,12 @@ In the following examples, we assume that the relevant functions have already
been imported from the :mod:`subprocess` module.
Replacing /bin/sh shell backquote
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Replacing :program:`/bin/sh` shell command substitution
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: bash
output=`mycmd myarg`
output=$(mycmd myarg)
becomes::
@ -1182,7 +1182,7 @@ Replacing shell pipeline
.. code-block:: bash
output=`dmesg | grep hda`
output=$(dmesg | grep hda)
becomes::
@ -1199,7 +1199,7 @@ be used directly:
.. code-block:: bash
output=`dmesg | grep hda`
output=$(dmesg | grep hda)
becomes::

View File

@ -218,8 +218,6 @@ library/stdtypes,,:len,s[len(s):len(s)]
library/stdtypes,,::,>>> y = m[::2]
library/stdtypes,,::,>>> z = y[::-2]
library/string,,`,"!""#$%&'()*+,-./:;<=>?@[\]^_`{|}~"
library/subprocess,,`,"output=`dmesg | grep hda`"
library/subprocess,,`,"output=`mycmd myarg`"
library/tarfile,,:bz2,
library/tarfile,,:compression,filemode[:compression]
library/tarfile,,:gz,

1 c-api/arg :ref PyArg_ParseTuple(args, "O|O:ref", &object, &callback)
218 library/stdtypes :: >>> y = m[::2]
219 library/stdtypes :: >>> z = y[::-2]
220 library/string ` !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
library/subprocess ` output=`dmesg | grep hda`
library/subprocess ` output=`mycmd myarg`
221 library/tarfile :bz2
222 library/tarfile :compression filemode[:compression]
223 library/tarfile :gz