function drush_os

8.0.x drush_os($site_record = NULL)
6.x drush_os($site_record = NULL)
7.x drush_os($site_record = NULL)
4.x drush_os($site_record = NULL)
5.x drush_os($site_record = NULL)
master drush_os($site_record = NULL)

Determine the appropriate os value for the specified site record

@returns NULL for 'same as local machine', 'Windows' or 'Linux'.

Related topics

4 calls to drush_os()
drush_backend_invoke_concurrent in includes/
Execute a new local or remote command in a new process.
drush_set_environment_vars in includes/
Set Env. Variables for given site-alias.
drush_shell_proc_build in includes/
Build an SSH string including an optional fragment of bash. Commands that use this should also merge drush_shell_proc_build_options() into their command options.
_drush_backend_generate_command in includes/
Generate a command to execute.


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


function drush_os($site_record = NULL) {
  // Default to $os = NULL, meaning 'same as local machine'
  $os = NULL;
  // If the site record has an 'os' element, use it
  if (isset($site_record) && array_key_exists('os', $site_record)) {
    $os = $site_record['os'];
  // Otherwise, we will assume that all remote machines are Linux
  // (or whatever value 'remote-os' is set to in drushrc.php).
  elseif (isset($site_record) && array_key_exists('remote-host', $site_record) && !empty($site_record['remote-host'])) {
    $os = drush_get_option('remote-os', 'Linux');

  return $os;