there should be an easy way to set the environment variables for a site in /etc/koha/sites, or to run a command on only one site through koha-foreach, or an interactive subshell.
So basically something that lets you do, e.g. koha-setenv mylibrary that drops you into a shell as the appropriate koha user with the KOHA_CONF variables set up? Cos that sounds like a useful thing to have to me. I'm in the habit of doing stuff like "sudo -u koha-mylibrary env KOHA_CONF=... command" but it'd be a good habit to break.
This is the functionality 'koha-shell' provides already.
koha-shell was added on 2012-12-20 (9 months after this report) for Bug 8878, but thanks for tidying this up. Changing the resolution to match. *** This bug has been marked as a duplicate of bug 8878 ***