krang_exec - run some piece of code under the Krang install


Run an external script

  $ krang_exec <

Run a simple command

  $ krang_exec -e "print $ENV{KRANG_INSTANCE}"

Run an SQL query and print the results

  $ krang_exec -qpe "SELECT COUNT(*) FROM story"


Sometimes it's extremely useful to be able to run a script or command for each installed instance of Krang. This makes it really easy to do so. It takes care of making sure all the paths to libraries are setup correctly, addons are loaded and other niceties.

By default it executes what's coming from STDIN.