[wp-hackers] Getting list of plugins from shell script

Scot Hacker shacker at birdhouse.org
Tue Aug 3 07:56:49 UTC 2010


Kind of obscure, but wondering if anyone has a script or command that can be used to derive a list of active plugins from the shell (not from PHP). I have this so far:

# Get list of active plugins from db
raw_plugins_sql="SELECT option_value FROM $dbname.wp_options WHERE option_name = 'active_plugins';"
echo $raw_plugins_sql
mysql -u root -e "$raw_plugins_sql" -p$root_db_pass $dbname

But the output is really messy and I can't seem to get any further with it (this  is part of a script where I'm trying to get a per-site listing of  active plugins used on each site on a server). Maybe need an awk expert here :)

Thanks,
Scot



More information about the wp-hackers mailing list