Previous Next Chapter

<a> EQ <b>

True if the text of a and b is identical (disregarding case).

VAL

Specifies a numeric comparison.

EXISTS <file>

True if the file exists.

If more than one of the three condition-flag keywords (WARN, ERROR, FAIL) are given, the one with the lowest value is used.

You can use local or global variables with IF by prefacing the variable name with a $ character.

Example 1:

IF EXISTS Work/Prog
TYPE Work/Prog HEX
ELSE
ECHO "It's not here"
ENDIF

AmigaDOS displays the file Work/Prog if it exists in the current directory. Otherwise, AmigaDOS displays the message It's not here and continues after the ENDIF.

Example 2:

IF ERROR
SKIP errlab
ENDIF
ECHO "No error"
LAB errlab

If the previous command produces a return code greater than or equal to 10, AmigaDOS skips over the ECHO command to the errlab label.

See also: EXECUTE, FAILAT, LAB, QUIET, SKIP. For more examples using the IF command, see Chapter 8.

INFO

Gives information about mounted devices.

Format

INFO [<device>]

Template

DEVICE

Location

C:

INFO displays a line of information about each mounted storage device, including floppy disk drive and hard disk partitions. Listed are the unit name, maximum size of the disk, the used and free space in blocks, the percentage of the disk that is full, the number of soft disk errors that have occurred, the status of the disk, and the name of the disk.

With the <device> argument, INFO provides information on the specified device or volume only.

Example:

1>INFO

Unit Size Used Free Full Errs Status Name
DF0: 879K 1738 20 98% 0 Read Only Workbench
DF1: 879K 418 1140 24% 0 Read/Write Text-6

Volumes available:
Workbench [Mounted]
Text-6 [Mounted]

INSTALL

Writes or inspects a boot blocks on a formatted floppy disk or PCMCIA card, specifying whether it should be bootable.

Format

INSTALL [DRIVE] <DF0: | DF1: | DF2: | DF3: | CC0:> [NOBOOT] [CHECK] [FFS]

Template

DRIVE/A,NOBOOT/S,CHECK/S,FFS/S

Location

C:

INSTALL clears a floppy disk's or PCMCIA memory card's boot block area and writes a valid boot onto it. INSTALL does not affect any files or directories on the disk or card. The necessary files and directories must still be present on a device to boot from it successfully.

The NOBOOT option removes the boot block from an AmigaDOS disk or card, making it not bootable.

The CHECK option checks for valid boot code. It reports whether a disk or card is bootable and whether standard Commodore-Amiga boot code is present on the media. This is useful in detecting some viruses.

The FFS switch is ignored. It remains part of the template to ensure compatibility with earlier scripts and programs.

Example 1:

1> INSTALL DF0: CHECK
No bootblock installed

indicates that there is a non-bootable floppy in DF0:.

Example 2:

1> INSTALL DF0:

makes the disk in drive DF0: a bootable disk.

Example 3:

1> INSTALL DF0: CHECK
Appears to be FFS bootblock

indicates that there is a bootable FFS floppy in DF0:.

JOIN

Concatenates two or more files into a new file.

Format

JOIN [FILE] <file | pattern>} AS | TO <filename>

Template

FILE/M/A,AS=TO/K/A

Location

C:

JOIN copies all the listed files, in the order given, to one new file. This destination file cannot have the same name as any of the source files. You must supply a destination file name. The original files remain unchanged. Any number of files can be JOINed in one operation.

TO can be used as a synonym for AS.

Example:

1> JOIN Part1 Part2 Part3 AS Textfile

For another example using JOIN, see Chapter 8.

LAB

Specified a label in a script file.

Format

LAB [<string>]

Template

(none)

Location

Internal

LAB is used in script to define a label that is searched for by the SKIP command. The label <string> can be of any length, but must be alphanumeric. No symbols are allowed. If the <string> contains spaces, it must be enclosed in quotation marks.

See also: SKIP, IF, EXECUTE. For more examples using LAB, see Chapter 8.

LIST

Lists specified information about directories and files.

Format

LIST [{<dir | pattern | filename>}] [P | PAT <pattern>] [KEYS] [DATES] [NODATES] [TO <name>] [DUB <string>] [SINCE <date>] [UPTO <date>] [QUICK] [BLOCK] [NOHEAD] [FILES] [DIRS] [LFORMAT <string>] [ALL]

Template

DIR/M,P=PAT/K,KEYS/S,DATES/S,NODATES/S,TO/K,SUB/K,SINCE/K,UPTO/K,QUICK/S,BLOCK/S,NOHEAD/S,FILES/S,DIRS/S,LFORMAT/K,ALL/S

Location

C:

LIST displays information about the contents of the current directory. If you specify a <dir>, <pattern>, or <filename> argument, LIST displays information about the specified directory, all directories or files that match the pattern, or the specified file, respectively. The PAT argument lets you specify an additional pattern to match.

Unless other options are specified, LIST displays the following:

name

The name of the file or directory.

size

The size of the file in bytes. If there is nothing in this file, the field reads "empty". For directories, this entry reads "Dir".

protection

The protection bits that are set for this file are shown as letters. The clear (unset) bits are shown as hyphens. Most files show the default protection bits, ----rwed for readable/writable/executable/deletable. See the PROTECT command for more on protection bits.

date and time

The date and time the file was created or last changed.

comment

The comment, if any, placed on the file using the FILENOTE command. It is preceded by a colon (:).

LIST uses the following options to change the way the output is displayed:

Top Previous Next Chapter