function drush_shell_exec

8.0.x drush_shell_exec($cmd)
6.x drush_shell_exec($cmd)
7.x drush_shell_exec($cmd)
3.x drush_shell_exec($cmd)
4.x drush_shell_exec($cmd)
5.x drush_shell_exec($cmd)
master drush_shell_exec($cmd)

Executes a shell command. Output is only printed if in verbose mode. Output is stored and can be retrieved using drush_shell_exec_output(). If in simulation mode, no action is taken.


$cmd: The command to execute. May include placeholders used for sprintf.

...: Values for the placeholders specified in $cmd. Each of these will be passed through escapeshellarg() to ensure they are safe to use on the command line.

Return value

TRUE on success, FALSE on failure

Related topics

30 calls to drush_shell_exec()
DrushMakeProject::applyPatches in commands/make/
Retrieve and apply any patches specified by the makefile to this project.
drush_archive_dump in commands/core/
Command callback. Generate site archive file.
drush_complete_match_file in includes/
Retrieves the appropriate list of candidate file/directory completions, filtered by the last word that we are trying to complete.
drush_config_edit in commands/core/
Edit command callback.
drush_config_import in commands/core/
Command callback. Import from specified config directory (defaults to sync).

... See full list

4 string references to 'drush_shell_exec'
drush_shell_cd_and_exec in includes/
Executes a shell command at a new working directory. The old cwd is restored on exit.
make_download_bzr in commands/make/
Checks out a Bazaar repository to the specified download location.
make_download_git in commands/make/
Checks out a git repository to the specified download location.
make_download_svn in commands/make/
Checks out an SVN repository to the specified download location.


includes/, line 80
Functions for executing system commands. (e.g. exec(), system(), ...).


function drush_shell_exec($cmd) {
  return _drush_shell_exec(func_get_args());