drush vset array value


How to set a variable to an array value via drush - source http://drupal.org/node/664452#comment-5078776

Get raw version
  1. php -r "print json_encode(array('drupal', 'simpletest', 'leftandright', 'category'));" | drush vset --format=json project_dependency_excluded_dependencies -


tedbow's picture

Is this simpler than the code below?

drush php-eval "variable_set('project_dependency_excluded_dependencies',array('drupal', 'simpletest', 'leftandright', 'category'));"

Dhaval Panara's picture

Any buddy knows why we are adding a hyphen(-) sign in last?

Jaesin's picture

"-" tells drush to take the input from stdin.