The ALL command line interface is the same on MS-DOS and OpenVMS. It adheres largely to DOS conventions, especially as far as option strings (known as qualifiers under OpenVMS) are concerned.
Unlike other DOS programs ALL prompts for user input when an option requires a value and none was specified.
If you find that you use the same options in most cases you can make use of the ALLOPT environment variable that is evaluated by ALL whenever it runs. Assign such options to the variable using the SET command under DOS or the symbol assigment operator (:==) under OpenVMS.
A good way of using this facility would be to assign the /t option to the ALLOPT variable so that ALL always starts in test mode and never directly executes the commands it builds. This may prevent problems if the commands built differ substantially from what you had in mind. To execute the command after verifying that it is correct just recall the ALL command and add a negated /t option (/-t) to it and the effect of the ALLOPT definition will be neutralized.
ALL accepts two parameters on the command line:
The input file is the file from which ALL reads the data to transform into commands or other data. It can contain file specifications or any other kind of non-binary data.
Input data can come from the following sources:
Example: all input.dat "~t!r!" /t /otabbed.dat
Example: dir /s /b | all "echo The file name is !fn!"
Example: all *.dat "type !fn!!fe!" /c
If the input file specification is missing because the /F option was used or input comes from a pipe (not under OpenVMS), the first parameter is assumed to be the template string. If input does not come from a pipe and the /F option is not used input is read from the keyboard.
If the input file parameter contains any wildcards (only on DOS) ALL generates the input itself creating an input list containing all file names (including the path) that match the wildcard file specification. Wildcard handling is done in the same way that DOS commands do it with one exception:
a file specification like
If you need better wildcarding than DOS provides you can use the /M option on the filename field to apply regular expression matching to a field. See the description of the /M option for more detailed information.
The template string parameter tells ALL what data to output and how, or which command to execute. It will normally be enclosed in double quotes because almost all commands to be built by ALL will contain at least one blank.
The ALL command interface adheres to DOS conventions. Option characters are case-sensitive when both the lower and upper case versions of an option are available (e.g. /t = test mode, /Tfilename = template file specification). If an option character is only used once (like "v" which only stands for "verbose mode") case does not matter.
Options may be denoted by either a "/" or a "-" character preceding the option character. Negatable options can be negated by preceding the option character with a minus sign.
If a string is added to an option there must not be any whitespace between the option character and the string.
On OpenVMS, any input that a program written in C, like ALL, receives from the command line and that is not enclosed in double quotes (") is converted to lower case before it is passed to the program. Thus lower case option characters do not represent a problem while upper case option characters and any arguments they take must be enclosed in double quotes. For example, a template file would be specified on OpenVMS as follows:
all /Finput.lis "/Ttemplate.file"
/A{file} - Append fileThe /A option lets you name a file to be appended to the output generated by ALL. If the /a option is also specified, its value string is appended after the append file has been copied to the output.
The /a option lets you specify a string to be appended to the output generated by ALL. If the /A option is also specified to append a file to the output, the append string is appended to the contents of the append file.
The /B option lets you specify a different base number than 1 for the first record in the input. Normally, the value of the first !n! in an ALL run would be 1; using /B20, for example, counting starts at 20.
The /b option forces ALL to copy blank lines to the output. By default, blank lines are removed.
There are two confirm options that differ in scope. The /c option (lowercase) lets you confirm all concatenated commands in a template string by confirming once (global mode confirmation), the /C option (uppercase) requires individual confirmation of each single command (single mode confirmation).
Another difference is that commands in single mode are written to the output file whether confirmed or not. This is because single mode confirmation seems for interactive work more than batch processing.
Use the /d option to specify a delimiter string that is to be used to delimit the parameters P1 to Pn instead of the default characters blank and tab. The delimiter string is not to be considered a string that is to be found in whole, but any of the characters in the string will delimit the parameters on its own.
Use the /D option to specify a field definition file containing information for ALL on how to parse the input records.
If you use the /D option without specifying a file ALL assumes ALL.ALD as the default file specification.
The /e option allows you to execute an output command file created using the /o option.
This is useful in the following cases:
This is true for the OpenVMS operating system where a new subprocess would be spawned for every single command to be executed, and under which the creation of processes is relatively time consuming.
Command and batch files can be interrupted by pressing Ctrl-C once, whereas with single command execution, Ctrl-C must be pressed for every single command.
After execution the command file is deleted automatically unless you have included the /k (keep) option on the command line.
By default, the "~" character is recognized by ALL as the control sequence introducer. The /E option can be used to specify a different character.
Using the /f option you can specify the format of the output file that ALL creates. This is convenient in cases where you run ALL on one operating system but the resulting output file is to be used on another operating system.
Valid specifiers are d (DOS) and u (Unix). The default is operating system specific, i.e. it is d on DOS systems and u on Unix systems. This feature comes in handy if you want to work with files from a Unix file system using Unix tools but you are running ALL from DOS. The /f option does not only generate the system native line ends (CRLF on DOS, LF on Unix) but also manipulates those ALL fields that contain file specification portions so that they best fit their purpose on the target file system. For example, the drive portion is completely left out for Unix target systems because there is no such thing on Unix and the backslashes found in DOS path names are changed to slashes as is the Unix convention.
Example with DOS output format:
C:\WFW>all *.txt "rm !r!" /t ALL V2.15.0 Copyright (c) 1992 - 1996 Michael Walter rm C:\WFW\SETUP.TXT rm C:\WFW\BOOTLOG.TXT rm C:\WFW\LOGFILE.TXT ALL: Number of output records: 3
Example with Unix output format:
C:\WFW>all *.txt /fu "rm !fs!" /t ALL V2.15.0 Copyright (c) 1992 - 1996 Michael Walter rm /wfw/setup.txt rm /wfw/bootlog.txt rm /wfw/logfile.txt ALL: Number of output records: 3
The /F option is used to specify the file from which ALL reads ist input. If no file name is given ALL.DAT is assumed as the input file.
Another way to specify an input file is to just use its name as a parameter instead of as an option value.
The /H option can be specified to display help information on the screen. In addition to a short description of each option, ALL displays the program defined fields.
The /h option allows you to specify a line that should be considered a header line containing field names, not data. The default line number is 1. The names found in the specified line can be used as field names in the template string or file. Using the /h option requires using the /d (delimiter) option.
The /k option lets you keep a command file after execution via the /e option. Normally, command files created by ALL are deleted after they are run.
ALL can produce its own input file if you tell it the appropriate command string. This command must create an output file that must be given as an option value to the /F option in the same ALL command.
If the command string contains whitespace or characters that should not be interpreted by the operating system command shell, enclose the whole option string including the option introducer and character in double quotes.
The /m option lets you execute commands or generate output selectively depending on the string value of a particular field. Only one fieldname - string combination can be specified.
There are three special characters that determine the way that string matching is applied:
Match characters and their meanings | |
---|---|
Character | Meaning |
= | The whole string must match; comparison is not case-sensitive |
=~ | The string to match must at least be a substring of the field value with which it is compared. Comparison is case-sensitive |
^ | Like "=", but the string must NOT match |
^~ | Like "=~", but the string to match may NOT be contained in the field value |
The /M option lets you execute commands or generate output selectively depending on the value of a particular field. Only one fieldname - string combination can be specified.
Choose the /M instead of the /m option whenever you need to specify regular expressions as search patterns.
There are two special characters that determine the way that string matching is applied:
Match characters and their meanings | |
---|---|
Character | Meaning |
= | The regular expression and the field value string must match |
^ | The regular expression and the field value string must NOT match |
Because a regular expression is also searched for in the middle of the field value string there is no need for a "~" character to specify substring matching. On the contrary, if you want to match the whole of a field value the regular expression needs to be anchored to the beginning-of-line character (^).
The /n option causes ALL to consider the whole of the input line a file specification. This is necessary to enable correct handling of file specifications containing blanks under Windows 95/98/NT correctly. Otherwise, ALL would only the treat the first token delimited by whitespace (blanks or tabs) as a file specification. See Long Filename Support for more information.
The /o option lets you specify a file to which the output generated by ALL should be written. If no file name is supplied, the output file will be named ALLCMDS.BAT under DOS, allcmds.cmd under Windows 95/98/NT or ALLCMDS.COM under OpenVMS.
The /P option lets you name a file to be copied to the output before any other output generated by ALL. If the /p option is also specified its value string precedes the prefix file.
The /p option lets you specify a string to be written to the output before any other output generated by ALL. If the /P option is also specified the prefix string precedes the contents of the prefix file in the output.
The /q option can be used to prevent the commands or records built from being displayed. This is especially useful when the /o option is specified too.
The /r option lets you remove the characters specified in string from the output. Removal takes place right before the output record created is written.
The /R option lets you replace the characters specified in the first half of string with those in the second half in the output records. The substitution takes place right before the output record created is written. An example option might be /RabcXYZ, which would replace the lowercase characters "a", "b", and "c" with the uppercase characters "X", "Y", and "Z", where "a" would be replaced with "X" and so on.
The /s option lets you skip any number of lines at the beginning of a file. This is useful for working with files that represent a table with some header lines that should not be processed by ALL. The output of the DOS DIR command or the OpenVMS SHOW SYSTEM command can be considered such files.
Whenever a split character (a '&' by default) is found in the template string ALL considers this the start of a new command. Use the /S option to specify a different split character if, for example, the ampersand character is contained in the input file and cannot be escaped.
The /t option lets you see the output command or file as it would be produced by ALL but prevents it from being executed.
Use the /t option for the following tasks:
The /T option allows you to use a template that is stored in a file instead of supplying a template as a parameter on the command line.
Store templates in files when they are not short and you use them often or when the command line buffer is to small to hold them, which can easily happen on DOS. It is also more convenient to edit long template strings in a file than on the command line.
The default name for the template file if you do not specify a file name is ALL.TPL.
If you do not want ALL's program identification or other information like the number of records processed you can suppress it by specifying the /v option with a value of 0. Other levels are accepted but are currently disregarded.
The /w option instructs ALL to wait the specified number of seconds after executing a command or command sequence before the next command is executed. The default wait period when just the /w is specified is 1 second.
This is useful in cases where a race condition needs to be avoided, for example when ALL creates output that needs to be processed by another machine in the network but this machine can not process the output fast enough and would otherwise get some kind of overflow or the disk would be filled up to fast etc.
ALL uses two different methods of implementing the wait option:
In both modes ALL shows the SLEEP command on the screen unless the /q option has been specified. This does not mean, however, that for execution a SLEEP command needs to be available.
Specify the /W option to keep whitespace at the start and end of the template string. By default, any blanks or tabs in these positions are removed.
[Table of Contents]