Lines Matching refs:shell
45 .. function:: call(args, *, stdin=None, stdout=None, stderr=None, shell=False)
61 >>> subprocess.call("exit 1", shell=True)
66 Using ``shell=True`` can be a security hazard. See the warning
77 .. function:: check_call(args, *, stdin=None, stdout=None, stderr=None, shell=False)
95 >>> subprocess.check_call("exit 1", shell=True)
104 Using ``shell=True`` can be a security hazard. See the warning
115 .. function:: check_output(args, *, stdin=None, stderr=None, shell=False, universal_newlines=False)
136 >>> subprocess.check_output("exit 1", shell=True)
147 ... shell=True)
154 Using ``shell=True`` can be a security hazard. See the warning
212 a single string, either *shell* must be :const:`True` (see below) or else
233 If *shell* is ``True``, the specified command will be executed through
234 the shell. This can be useful if you are using Python primarily for the
236 convenient access to other shell features such as shell pipes, filename
239 implementations of many shell-like features (in particular, :mod:`glob`,
245 Executing shell commands that incorporate unsanitized input from an
246 untrusted source makes a program vulnerable to `shell injection
249 For this reason, the use of ``shell=True`` is **strongly discouraged**
256 >>> call("cat " + filename, shell=True) # Uh-oh. This will end badly...
258 ``shell=False`` disables all shell based features, but does not suffer
260 documentation for helpful hints in getting ``shell=False`` to work.
262 When using ``shell=True``, :func:`pipes.quote` can be used to properly
263 escape whitespace and shell metacharacters in strings that are going to
264 be used to construct shell commands.
280 stderr=None, preexec_fn=None, close_fds=False, shell=False, \
292 platform-dependent and described below. See the *shell* and *executable*
314 as *eggs.txt*) that are separated by whitespace in the shell go in separate
316 used in the shell (such as filenames containing spaces or the *echo* command
323 The *shell* argument (which defaults to ``False``) specifies whether to use
324 the shell as the program to execute. If *shell* is ``True``, it is
327 On Unix with ``shell=True``, the shell defaults to :file:`/bin/sh`. If
329 to execute through the shell. This means that the string must be
330 formatted exactly as it would be when typed at the shell prompt. This
333 any additional items will be treated as additional arguments to the shell
338 On Windows with ``shell=True``, the :envvar:`COMSPEC` environment variable
339 specifies the default shell. The only time you need to specify
340 ``shell=True`` on Windows is when the command you wish to execute is built
341 into the shell (e.g. :command:`dir` or :command:`copy`). You do not need
342 ``shell=True`` to run a batch file or console-based executable.
346 Passing ``shell=True`` can be a security hazard if combined with
363 is very seldom needed. When ``shell=False``, *executable* replaces the
369 :program:`ps`. If ``shell=True``, on Unix the *executable* argument
370 specifies a replacement shell for the default :file:`/bin/sh`.
452 system shell implicitly. This means that all characters, including shell
454 shell is invoked explicitly, then it is the application's responsibility to
566 Note that if you set the *shell* argument to ``True``, this is the process ID
567 of the spawned shell.
630 :class:`Popen` is called with ``shell=True``.
673 This flag is always set when :class:`Popen` is created with ``shell=True``.
706 Replacing /bin/sh shell backquote
717 Replacing shell pipeline
734 Alternatively, for trusted input, the shell's own pipeline support may still
743 output=check_output("dmesg | grep hda", shell=True)
753 status = subprocess.call("mycmd" + " myarg", shell=True)
757 * Calling the program through the shell is usually not required.
762 retcode = call("mycmd" + " myarg", shell=True)
806 pipe = Popen("cmd", shell=True, bufsize=bufsize, stdout=PIPE).stdout
812 pipe = Popen("cmd", shell=True, bufsize=bufsize, stdin=PIPE).stdin
818 p = Popen("cmd", shell=True, bufsize=bufsize,
828 p = Popen("cmd", shell=True, bufsize=bufsize,
839 p = Popen("cmd", shell=True, bufsize=bufsize,
845 directly to the program without shell intervention. This usage can be
862 process = Popen("cmd", shell=True, stdin=PIPE)
876 p = Popen("somestring", shell=True, bufsize=bufsize,
882 shell intervention. This usage can be replaced as follows::