Options File Syntax
You can specify mlcp options using an options file, in addition to using command line options by using -options_file
. Using an options file is especially convenient when working with options whose values contain quotes and other special characters that are difficult to escape on the command line.
If you use an options file, it must be the first option on the command line. The mlcp command (import, export, copy) can also go inside the options file. For example:
$ mlcp.sh -options_file my_options.txt -input_file_path /example
An options file has the following contents:
Each line contains either a command name, an option, or an option value, ordered as they would appear on the command line.
Comments begin with “#” and must be on a line by themselves.
Blank lines, leading white space, and trailing white space are ignored.
For example, if you frequently use the same MarkLogic Server connection information (host, port, username, and password), you can put this information into an options file:
$ cat my-conn.txt # my connection info -host localhost -port 8000 -username me -password my_password # Windows users, see Modifying the Example Commands for Windows $ mlcp.sh import -options_file my-conn.txt \ -input_file_path /space/examples/all.zip
This is equivalent to the following command line without an options file:
# Windows users, see Modifying the Example Commands for Windows $ mlcp.sh import -host localhost -port 8000 -username me \ -password my_password -input_file_path /space/examples/all.zip
You can also include a command name (import, export, or copy) as the first non-comment line in an options file:
# my connection info for import
import-host
localhost
-port
8000
-username
me
-password
my_password