COPYPLUS
[/?]
[/A[+|-]drash]
[/S[+|-]drash]
[/E/N/Q/U/V[+|-]]
Sources…
[Destination]
/?/AThe traditional alternative meaning for the /A option in the COPY command is not required and thus its consequent syntactic oddities are not implemented.
/S/E/N/U/Q/VThe COPYPLUS command provides the full functionality of the "traditional" COPY command. As a consequence, like the latter its command line syntax is idiosyncratic, its semantics are complex, and it does not operate quite like any other commands. For a simpler command that supports the most common usage of the "traditional" COPY command and that operates in the way that the MOVE and RENAME commands do, use the supplied COPYSTD command instead.
The COPYPLUS command copies files, optionally concatenating them with other files in the process.
The COPYPLUS command first processes the contents of the CMD_COPY_INIT environment variable, if it has inherited one, as if it were a command tail, before processing any of the command tails that have been passed to it. This allows one to modify default options globally. (One can use command aliases or wrapper scripts to achieve the same effect.)
The non-option arguments to COPYPLUS comprise a series of source specifications, followed by an optional destination specificiation.
Each source specification comprises a primary wildcard specifications, optionally followed by zero or more secondary wildcard specifications each preceded with a '+' (plus) character. The optional destination specification comprises just a substitution wildcard specification.
COPYPLUS operates as follows:
If there is exactly one source specification and that source specification contains at least one secondary substitution wildcard specification, then COPYPLUS performs a simple append operation. COPYPLUS searches the directory using the primary wildcard specification as a directory search wildcard. For each directory entry so found, it then iterates over all of the secondary wildcard specifications, using them as substitution wildcards modified by the name of the directory entry that was found, and appends each source file so constructed to the original file.
Otherwise, if there is no destination specification the default destination specification of "*" is used.
If the destination specification ends in a slash, it is an explicit directory, and "*" is appended to it. It is then treated as a wildcard destination.
If the destination specification contains wildcard characters, it is a wildcard specification. For each of the source specifications, COPYPLUS searches the directory using the primary wildcard specification as a directory search wildcard. For each directory entry found, COPYPLUS creates the name of the target file using the destination specification as a substitution wildcard to transform the directory entry that was found. It first copies the source file to the target file. It then iterates over all of the secondary wildcard specifications, using them as substitution wildcards modified by the name of the directory entry that was found, and appends each source file so constructed to the target file.
In other words, this is a way of taking multiple sets of source files, concatenating them together, and copying them to individual targets.
If the destination specification does not contain wildcard characters, COPYPLUS treats all of the specificiations, primary and secondary, as directory search wildcards. It scans the directory using each wildcard in turn, either copying or appending the source file to the destination, accorinding to whether or not it was the first directory entry that was found.
In other words, all of the source files are concatenated into one big target.
To iterate over all *.TOP files, concatenating the matching *.MID and *.BOT files if present, use the command:
[c:\]copyplus *.top+*.mid+*.bot 1.mid ->> 1.top 1.bot ->> 1.top 2.mid ->> 2.top 2.bot ->> 2.top 4 files copied of 2 files found.
To iterate over all *.TOP files, concatenating the matching *.MID and *.BOT files if present, placing the results in multiple *.TXT files, use the command:
[c:\]copyplus *.top+*.mid+*.bot *.txt 1.top -> 1.txt 1.mid ->> 1.txt 1.bot ->> 1.txt 2.top -> 2.txt 2.mid ->> 2.txt 2.bot ->> 2.txt 6 files copied of 2 files found.
Notice that even if the files 3.MID and 3.BOT exist, the above command does not copy them because the file 3.TOP does not exist. *.TOP is the only directory search wildcard; *.MID, *.BOT, and *.TXT are substitution wildcards used on all of the filenames resulting from the directory search.
To iterate over all *.TOP, *.MID, and *.BOT files, placing the results in one big file named DOCUMENT, use the command:
[c:\]copyplus *.top+*.mid+*.bot document 1.top -> document 2.top ->> document 1.mid ->> document 2.mid ->> document 3.mid ->> document 1.bot ->> document 2.bot ->> document 3.bot ->> document 8 files copied of 8 files found.
COPY MORE MOVE RENAME DEL DESCRIBE TRUENAME TYPE