.TH DISPARM 1 .SH NAME disparm \- alias using disparmcmd to call the program disparmcmd .SH SYNOPSIS .B disparm \fB\ -h,--help \fP .P 8 .B disparm \fB\ -c,--create \fP [\fB OPTIONS\fP ] [\fB -i,--input INPUTFILE \fB] .P 8 .B disparm \fB\ -n,--next \fP [\fB OPTIONS\fP ] [\fB -m,--max MAX \fB] .P 8 .B disparm \fB\ -r,--ready \fP [\fB OPTIONS\fP] [\fB -k, --key KEY \fP ] .P 8 .B disparm \fB\ -R,--REMOVE \fP [\fB OPTIONS\fP] [\fB -p, --pool POOL \fP ] .P 8 .B disparm \fB\ -s,--stats [\fB -p, --pool POOL \fP ] .P 8 .B disparm \fB\ -u,--unhandled [\fB -p, --pool POOL \fP ] .P 8 .B disparm \fB\ -D,--debug [\fB -p, --pool POOL \fP ] .SH DESCRIPTION disparm is an alias using disparmcmd, an utility to distribute strings (parameters) in a pool, in an orderly way. In general, the strings are used as command parameters, see Examples. .SH COMMANDS .TP 4 .B -h,--help Prints usage information. .TP 4 .B -c,--create [ -i,--input INPUTFILE ] [ -p,--pool POOL ] Creates new pool and fills it with lines from INPUTFILE, default from stdin. INPUTFILENAME '-' stands for stdin. See OPTIONS for a description of POOL. The environment variable 'DISPARM_RC' is set, see ENVIRONMENT. .TP 4 .B -n,--next [ -m,--max MAX ] [ -p,--pool POOL ] Gets the next string. The environment variables DISPARM_RC, DISPARM_VALUE, DISPARM_COMMITTED and DISPARM_KEY are set, see ENVIRONMENT. The same string in the pool will be produced MAX times, the default is 1. By setting this to a higher value, the same string will be produced more times. This can be useful for dealing with crashed jobs. See OPTIONS for a description of POOL. .TP 4 .B -r,--ready [ -k,--key KEY ] [-p,--pool POOL ] Marks the token with key KEY as ready. If not specified on the commandline, the value of environment variable DISPARM_KEY is used. See OPTIONS for a description of POOL. .TP 4 .B -R,--REMOVE --p,--pool POOL ] Removes the pool. See OPTIONS for a description of POOL. .TP 4 .B -s,--stats Prints to standard error: .br total number of strings in pool .br number of strings delivered .br number of strings marked as ready .br maximum one string has been delivered .TP 4 .B -u,--unhandled Prints to standard error the strings that are committed, but not marked as ready. .TP 4 .B -D,--debug Prints to standard error some debug information. .SH OPTIONS All options accept the following general parameters: .TP 4 .B -p,--pool POOL POOL is a unique name of the file that contains the pool. Default: pool.disparm in the current directory. .TP 4 .B -d,--lockdir LOCKDIR LOCKDIR is a directory to hold the lockfile (implemented as a hard link to the pool file). All lockfiles have different names, so it is permitted to use the same directory for all uses of disparm. Default: the directory where the pool resides. .SH ENVIRONMENT The following environment variables can be set by disparm: .P .B DISPARM_RC if the value is OK, than no errors were found .P .B DISPARM_KEY contains the keyvalue of the token .P .B DISPARM_LINENO contains the line number of the string in the file from which the pool file has been created .P .B DISPARM_COMMITTED contains the number of times the string has been committed before .P .B DISPARM_VALUE contains the token .SH EXAMPLES .TP 4 Create a pool with the firat 10 lines from the man page of sed: man sed | head > parmfile disparm -c -p demo1 -i parmfile Get a line: disparm -n -p demo1 The environment variable DISPARM_VALUE contains now one of the first ten lines of the man page of sed. You can use this in a command like this: eval "myparser $DISPARM_VALUE" The token can be marked as ready by: disparm -r -p demo1 Finally, the pool can be completely removed by: disparm -R -p demo1 .SH "SEE ALSO" sara-get-mem-size(1), sara-get-num-cores(1), disparmcmd(1) .SH AUTHORS Willem Vermin .br .SH BUGS No bugs known yet.