# koha-shell

Koha is the first free software library automation package.
Robin Sheat
Catalyst IT http://www.catalyst.net.nz
Author
koha-shell 8
koha-shell Gives you a shell with the user and environment set to make it easy to do koha operations. UNIX/Linux
`koha-shell` `--command|-c` COMMAND `--help|-h` `--login|-l` `--preserve-environment|-p|-m` `--shell|-s` SHELL `--verbose|-v` instancename

### Options

`--command`

  Run the specified command rather than launching a shell.

`--help`

  Show a usage synopsis.

`--login`

  Make the shell a login shell.

`--preserve-environment`

  Preserve the current environment (note that if you run it through 'sudo', this may not work as you'd expect.)

`--shell`

  Run the specified shell. The default is the shell of the current environment, followed by /bin/sh.

`--verbose`

  Show the command that is going to be run.

### Description

This launches a shell with the user and required environment variables set in such a way that running any Koha commands will work correctly. With the use of '-c', it can be used to easily run commands in the correct environment.

It behaves mostly as a wrapper for `su(1)`, so a deeper discussion of the options can be found in there.

### Examples

To get a shell:

`$ sudo koha-shell library`

To run a command:

`$ sudo koha-shell -c "/usr/share/koha/bin/migration_tools/bulkmarcimport.pl -b -file data.marc" library`

### See also

- `koha-foreach(8)`
- `su(1)`