function drush_remote_host

8.0.x drush_remote_host($site, $prefix = '')
6.x drush_remote_host($site, $prefix = '')
7.x drush_remote_host($site, $prefix = '')
5.x drush_remote_host($site, $prefix = '')
master 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/
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/
Convert from an alias record to a site specification
drush_sitealias_evaluate_path in includes/
Evaluate a path from its shorthand form to a literal path usable by rsync.


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


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;