Previous Next Chapter

Format

PATH [{<dir>}] [ADD] [SHOW] [RESET] [REMOVE] [QUIET]

Template

PATH/M,ADD/S,SHOW/S,RESET/S,REMOVE/S,QUIET/S

Location

Internal

PATH lets you see, add to, or change the search path the AmigaDOS follows when looking for a command or program to execute. When a directory is in the search path, you do not need to specify the complete path to any command within that directory. Entering the name alone makes AmigaDOS look through the directories in the search path until it finds the file.

Note:

The search path is only relevant when AmigaDOS is searching for a command or program to execute. Full path specifications are always necessary in arguments for commands such as COPY and DELETE.

Enter the PATH command alone or with the SHOW option to display directory names in the current search path. Normally, when PATH is displaying the directory names, a requester appears if a volume that is part of the search path cannot be found. For example, if you add a floppy disk to the search path and then remove that disk from the disk drive, a requester asks you to insert the disk.

If you specify the QUIET option, PATH does not display requesters for volumes that are not currently mounted. If PATH encounters an unmounted volume, it displays the message device (or volume) is not mounted . The names of any directories on that volume included in the PATH are not displayed.

The ADD option specifies directory to be added to the current PATH. You can add any number of directories with one PATH ADD command (the ADD keyword is optional); names of the directories must be separated by at least one space. When you issue the PATH command, AmigaDOS searches for each of the ADDed directories.

To replace the existing search path with a new one, use PATH RESET followed by the names of the new directories. The existing search path, except for the current directory and C:, is erased and the new one is substituted.

The REMOVE option eliminates the named directory from the search path.

Example:

1> PATH EXTRAS:Tools ADD

adds the Tools directory in the Extras drawer to the search path of the Shell. If the EXTRAS: is not in a disk drive, a requester asks you to insert it in any drive.

If you remove EXTRAS: from the drive and enter:

1> PATH

a list of directories in the search path is displayed. A requester asks you to insert EXTRAS:. If you enter:

1> PATH QUIET

the list of directories in the search path is displayed. However, when the path comes to Extras:Tools, the error message appears in the list.

See also: ASSIGN. For more examples using PATH, see Chapter 8.

PROMPT

Changes the prompt string of the current Shell.

Format

PROMPT [<prompt>]

Template

PROMPT

Location

Internal

PROMPT allows you to customize the prompt string, the text printed by the Shell at the beginning of a command line. The prompt string can contain any characters, including escape sequences.

This manual shows the prompt string as 1>.

The default prompt string is:

"%N.%S>"

which displays the Shell number, a period, the current directory, a right angle-bracket, and a space. Entering PROMPT without a string argument resets the prompt to this default.

The substitutions available for the <prompt> string are:

%N

Displays the process number for the Shell.

%S

Displays the current directory.

%R

Displays the return code for the last operation.

A space is not automatically added to the end of the string. If you want a space between the prompt and typed-in text, place it in the string, and enclose the string in double quotation marks,

You can embed commands in the prompt string by enclosing the command in back apostrophes (`).

Example 1:

1> PROMPT %N
1

Only the Shell number is shown. The > is removed from the prompt.

Example 2:

1> PROMPT "%N.%S.%R>"
1.Work:Snim.0>

The Shell number, current directory, and return code of the previous command are shown. A space is included after the >.

For more examples using the PROMPT command, see Chapter 8.

PROTECT

Changes the protection bits of a file or directory.

Format

PROTECT [FILE] <file | pattern> [FLAGS][+ | -] [<flags>] [ADD | SUB] [ALL] [QUIET]

Template

FILE/A,FLAGS,ADD/S,SUB/S,ALL/S,QUIET/S

Location

C:

All files and directories have a series of protection bits (attributes) stored with them that control their properties. These bits can be altered to indicate the type of file and the operations permitted. PROTECT is used to set or clear the protection bits. For directories, only the d bit is significant.

The protection bits are represented by letters:

s

The file is a script.

p

The file is a pure command and can be made resident.

a

The file has been archived.

r

The file can be read.

w

The file can be written to (altered).

e

The file is executable (a program).

d

The file or directory can be deleted. (Files within a delete-protected directory can still be deleted.)

Use the LIST command to see the protection bits associated with a file. The protection field is displayed with set (on) bits shown by their letters and clear (off) bits shown by hyphens. For example, a file that is readable, writable, and deletable has ----rw-d in the protection field.

To specify the entire protection field at the same time, enter the letters of the bits you want set as the FLAGS argument without any other keywords. The named bits are set and all the others are cleared.

The symbols + and - (or the equivalent keywords ADD and SUB) are used to control specific bits without affecting the state of unspecified bits. Follow + or - with the letters of the bits to set or clear, respectively, and only those bits are changed. There is no space after the symbol or between the letters. The order of the letters does not matter. ADD and SUB work similarly, but there must be a space between the keyword and the letters. You cannot both set and clear bits in the same command.

The ALL options adds or removes the specified protection bits from all the files and subdirectories matching the pattern entered. The QUIET option suppresses the screen output.

Example 1:

1> PROTECT DF0:Memo +rw

sets only the protection bits r (readable) and w (writable) of the file Memo on DF0:. No other protection bits are changed.

Example 2:

1> PROTECT L:#? e SUB

clears the e (executable) protection bit from all the files in the L: directory.

Example 3:

1> PROTECT Work:Paint rwed

The protection status of Paint becomes "----rwed".

QUIT

Exits from a script file with a specified return code.

Top Previous Next Chapter