1 <article xmlns='http://docbook.org/ns/docbook'>
2 <title>koha-shell</title>
4 <productname>Koha</productname> is the first free software library automation package.
7 <firstname>Robin</firstname>
8 <surname>Sheat</surname>
11 <orgname>Catalyst IT</orgname>
12 <uri>http://www.catalyst.net.nz</uri>
14 <contrib>Author</contrib>
18 <refentry xml:id="koha-shell">
21 <refentrytitle>koha-shell</refentrytitle>
22 <manvolnum>8</manvolnum>
26 <refname>koha-shell</refname>
27 <refpurpose>Gives you a shell with the user and environment set to make it easy to do koha operations.</refpurpose>
28 <refclass>UNIX/Linux</refclass>
33 <command>koha-shell</command>
34 <arg><option>--command|-c</option> COMMAND</arg>
35 <arg><option>--help|-h</option></arg>
36 <arg><option>--login|-l</option></arg>
37 <arg><option>--preserve-environment|-p|-m</option></arg>
38 <arg><option>--shell|-s</option> SHELL</arg>
39 <arg><option>--verbose|-v</option></arg>
40 <arg choice="req" rep="norepeat"><replaceable>instancename</replaceable></arg>
44 <refsect1><title>Options</title>
47 <term><option>--command</option></term>
49 <para>Run the specified command rather than launching a shell.</para>
53 <term><option>--help</option></term>
55 <para>Show a usage synopsis.</para>
59 <term><option>--login</option></term>
61 <para>Make the shell a login shell.</para>
65 <term><option>--preserve-environment</option></term>
67 <para>Preserve the current environment (note that if you run it through 'sudo', this may not work as you'd expect.)</para>
71 <term><option>--shell</option></term>
73 <para>Run the specified shell. The default is the shell of the current environment, followed by /bin/sh.</para>
77 <term><option>--verbose</option></term>
79 <para>Show the command that is going to be run.</para>
85 <refsect1><title>Description</title>
86 <para>This launches a shell with the user and required environment variables set in such a way that running any Koha commands will
87 work correctly. With the use of '-c', it can be used to easily run commands in the correct environment.</para>
88 <para>It behaves mostly as a wrapper for <command>su(1)</command>, so a deeper discussion of the options can be found in there.</para>
92 <title>Examples</title>
96 <para><command>$ sudo koha-shell library</command></para>
100 <para><command>$ sudo koha-shell -c "/usr/share/koha/bin/migration_tools/bulkmarcimport.pl -b -file data.marc" library</command></para>
103 <refsect1><title>See also</title>
104 <simplelist type="inline">
105 <member><command>koha-foreach(8)</command></member>
106 <member><command>su(1)</command></member>