wild ---- Documentation for version 2.0, on December 31th, 1991 by Bruno Costa WARNING Although this program is freely distributable (see COPYRIGHT below), I would appreciate if you take the time to write me a line or two (E-Mail please) if you are using any of my programs or if you have any kind of ideas or suggestions (This is not too much to ask, is it?). If you feel particularly generous, I would like to receive a disk with any useful programs you have written, preferrably with source. Thanks! DESCRIPTION Wild is a program that expands any wildcards passed to it and then executes the resulting command line, providing wildcard expansion capabilities to programs that do not recognize wildcards. This is somewhat similar to the way Unix shells execute commands: they get a line from the user, search for any wildcards in it, match them against disk directories and then execute the resulting expansion, so that (most) programs need not be aware of the existance of wildcards. Wild uses the wildcard expansion facilities provided by Workbench 2.0, and thus it supports all the wildcards WB2.0 offers, and obviously requires 2.0. Wild has also some additional features that help it to work with different kinds of program, like the abilities to quote the expanded files, split a long command line in a series of executions of the command, use '*' as a synonym for '#?' and handle options specially. OPTIONS usage: wild [-eqfdso] [-] {} ... e = instead of executing the resulting command line, just print it to the standard output. This is useful for debugging purposes or just to see the expansion of a potentially dangerous command (like `delete *a') before really executing it. q = quote arguments resulting from expansion. This is only useful if the command you want to run supports double-quotes as word delimiters (most do, but some assembly written ones don't), and if the filenames resulting from the expansion contain spaces. f = use only files resulting from the wildcard expansion, i.e., ignore directories (default is to use both). d = use only directories resulting from the wildcard expansion, i.e., ignore files (default is to use both). s = do not map a single star ('*') to '#?'. Normally, wild will convert any word that is made up by just one '*' to '#?', so that `rm *' means remove all files in this directory. Note that wild will not touch any other asterisks that may be present in the command line. To fully utilize the '*' as a wildcard under AmigaDOS 2.0, a bit in the RootNode structure of AmigaDOS must be turned set. This can be done by a separate utility, like WildStar -- see AC's TECH for the Commodore Amiga, Volume 1, Number 3. = call the command with at most n arguments, where n may be any single digit. If more than n arguments result from the wildcard expansion, the command will be executed multiple times. Arguments starting with a '-' will be considered as options for the command, and will be repeated each time it is executed. o = do not assume that arguments starting with a '-' are options, i.e., handle them as any other arguments. EXAMPLES Assume that there are two files in the current directory named file1 and file2, and two directories, dir1 and dir2. [In the following examples, the 'e' option is always given, so that you can see what would be executed in your computer. You have to suppress this option to make wild effectively execute something.] To display all files in this directory as IFF pictures: > wild -ef display * display file1 file2 To do the same as above if there was the possibility of spaces in the file names: > wild -efq display * display "file1" "file2" To delete just the sub-diretories (but not the files) of this directory: > wild -ed delete * delete dir1 dir2 To print the version of every file in this directory (note that the version command does not support multiple arguments): > wild -ef1 version * version file1 version file2 To show the first 15 lines of every file in this directory (using a Unix-like head command): > wild -ef head -15 * head -15 file1 file2 or > wild -ef1 head -15 * head -15 file1 head -15 file2 Note the effect of the 'o' switch compared to example above: > wild -ef1o head -15 * head -15 head file1 head file2 BUGS There should be a way to handle a different syntax for options, e.g., AmigaDOS command's options do not start with a dash -- still, they are options and should be handled accordingly. The maximum lenght of a command that wild can execute is 1024 characters, but there seems to be a smaller limit in the current AmigaDOS shell (Kickstart v36.209) that restricts this to a lower value (something around 512 characters, I think). Using a third-party shell, this limit may be different (even non-existant). See also the BUGS section in wildargs.doc (as wild is implemented using wildargs). AUTHOR The accompanying program and this documentation were written by Bruno Costa. He can be reached in the following ways: E-Mail: bruno@brlncc.bitnet (InterNet) bruno@BRLNCC (BitNet) Mail: Bruno Costa Rua Almirante Guilhem 454/102 bloco 1 Leblon - Rio de Janeiro RJ 22440 BRAZIL COPYRIGHT This program is copyrighted by Bruno Costa. It may be freely distributed if and only if the source code, the documentation and the executables are provided in original form. It may be included in Public Domain/Shareware compilations, like the one organized by Fred Fish, as long as just a nominal fee is charged for each disk (no more than US$10 per disk), and may also be uploaded to BBS's or network services like BIX and CompuServe. Note that the wildargs routines are a separate package that is in the public domain, as stated in wildargs.doc. DISCLAIMER The author makes no warranty of any kind with respect to this product and explicitly disclaims any implied warranties of merchantability or fitness for any particular purpose.