drush site-alias array I'm trying to script something up to completely automate synching sites around, and I want to be able to get a value out of the site alias which is an array.

If I do a

root@dev-drupal-www:~# drush sa @www.mysite.org.au
$aliases['www.mysite.org.au'] = array (
  'remote-host' =&gt; 'prod-drupalsites',
  'remote-user' =&gt; 'root',
  'uri' =&gt; 'www.mysite.org.au',
  'root' =&gt; '/vhost/www.mysite.org.au',
  'path-aliases' =&gt; 
  array (
    '%site' =&gt; 'sites/default/',
    '%files' =&gt; 'sites/default/files',
    '%dump' =&gt; '/tmp/drush_www.mysite.org.au.sql',
  ),
);
root@dev-drupal-www:~# drush sa @www.mysite.org.au --component="path-aliases"
Array
root@dev-drupal-www:~# drush sa @www.mysite.org.au --component="path-aliases:%dump"
The element path-aliases:%dump was not found in the alias record for @www.mysite.org.au.                                                                                                          [error]
root@dev-drupal-www:~# 


How can I extract an item from the path-aliases?

Thanks!
Unfortunately, (as you discovered), the site-alias command is not flexible enough to do what you want. There are other ways, though.  For your specific example above, which happens to involve paths, you can use the drupal-directory (dd) command:

$ drush dd @www.mysite.org.au:%dump
/tmp/drush_www.mysite.org.au.sql
$ drush dd @www.mysite.org.au:%files
/vhost/www.mysite.org.au/sites/default/files


For a more general-purpose solution, you could use the php-eval (ev) command:

$ drush ev '$a = drush_sitealias_get_record("@gk.dev"); print_r($a["path-aliases"]);'
Array
(
    [%boo] =&gt; /usr/local/boo
    [%root] =&gt; /srv/www/dev.greenknowe.org
)


This can, of course, be customized to suit, as the ev command will evaluate any arbitrary php you care to throw at it (as long as you escape special characters correctly). This is more complicated to use than the dd command, but it will also work for elements other than paths in the path-aliases element.