function drush_remote_host

8.0.x exec.inc drush_remote_host($site, $prefix = '')
6.x exec.inc drush_remote_host($site, $prefix = '')
7.x exec.inc drush_remote_host($site, $prefix = '')
5.x exec.inc drush_remote_host($site, $prefix = '')
master exec.inc drush_remote_host($site, $prefix = '')

Determine the remote host (username@hostname.tld) for the specified site.

Related topics

3 calls to drush_remote_host()
drush_shell_proc_build in includes/exec.inc
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_sitealias_alias_record_to_spec in includes/sitealias.inc
Convert from an alias record to a site specification
drush_sitealias_evaluate_path in includes/sitealias.inc
Evaluate a path from its shorthand form to a literal path usable by rsync.

File

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

Code

function drush_remote_host($site, $prefix = '') {
  $hostname = drush_escapeshellarg(drush_sitealias_get_option($site, 'remote-host', '', $prefix), "LOCAL");
  $username = drush_escapeshellarg(drush_sitealias_get_option($site, 'remote-user', '', $prefix), "LOCAL");
  return $username . (empty($username) ? '' : '@') . $hostname;
}