axargs: run command lines with parameters from stdin usage: {command} | axargs {options} [cmd] FILE[n] {par1} {par2} {parn} The axargs gets the lines on stdin, appends these values and {par...} to cmd and executes the command line. The following symbols can be used in command line generation: FILE: this will be replaced by the input file name FILE1: on multi input the first name is used FILE2, FILE3... The FILE[...] symbols can be omitted: in this case they will automatically appended to the end of the commands (it is enough the specifiy them when the client uses them in other positions, not in the last one). Parameters: -i [n]: multi input mode. The program reads n input and then assigns the values to FILE1 ... FILE[n] -print: the composed command lines will only be printed, instead of running them -chdir: change the current directory to that of the current file name (and change back to the original one after the execution, see examples) -a/--args: after this switch each parameter will be used for the generated commands. This can be used if the client application use a parameter that is interpreted (by default) by the axargs, too (and therefore would not be forwarded to the client). -pre {text}: specifies a prefix for the commands This text will be printed before the output of the executed command It can be useful to separate the output of the commands (especially in case of many lines) -post {text}: specifies a post-text for the commands -j {threadno}: specify the number of thread for the parallel execution If the number exceeds the number of physical processors, the physical max will be used. The number can be negative: this means the number of physical procs minus the absolute value (for better control over the threads). -ja: parallel execution with the number of physical processors -k: keep order. In case of parallel execution the outputs of the tasks can interfere (they write to the same terminal). With this option the outputs will be stored and printed after each task finished, in the same order as they were called (the order of the input lines). -s: stop on error: the execution finishes right after an 'error' (=the command returned a nonzero value). This applies to the parallel execution, too: in the case of an error, the already running parallel tasks finish and then the execution stops. Other parameters will be used as part of the command line (parameters for the executed program) Specifying the 'system' as client program name means that the input file name will be executed as a shell command (see the -chdir parameter, too). Examples: afind "*.obj" | axargs del FILE -> delete each .obj file (command: 'del temp\1.obj') afind "*.txt" | aconv file "name + '.doc'" | axargs -i 2 ren FILE1 FILE2 -> rename ecah .txt file to .doc afind "*.bat" | axargs system -chdir -> run each .bat file (the current directory will be that of the .bat file) afind "*.bat" | axargs ls -al -pre "------------------------------" -> the batch file properties will be printed, separated by a long line afind "*.bat" | axargs ls -al -ja -> file properties are listed in parallel execution (with max proc "load", the resulting order is undefined (changes from run to run)) afind "*.bat" | axargs ls -al -ja -k -> the same as the previous one, but in this case it keeps the original order ... | axargs -a client FILE -ja -> instead of the '-ja' being processed by the axargs, the client will get it