Home Page The Club Computers News Links Glossary EYAWTK
Before Amiga Background ICS OCS ECS AGA ??? AmigaOne
U-Boot SLB Linux Amiga OS Dual Boot Motherboards Peripherals Other
Initialisation Installation OS4 Updates About OS4 File Systems Networking Printing Other
Introduction File System Workbench Preferences Commands Error Msgs Miscellaneous

AmigaOS 4.0 - About OS4 - Commands

PATH Internal
Purpose: Controls the directory list that the Shell searches to find commands.
Format: PATH [{<dir>}] [FROM <filename>] [TO <filename>] [ADD] [REMOVE] [RESET] [SHOW] [HEAD] [QUIET]
Template: PATH/M, FROM/K, TO/K, ADD/S, REMOVE/S, RESET/S, SHOW/S, HEAD/S, QUIET/S
Path: 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 simply displays the volume name. The names of any directories on that volume included in the PATH are not displayed.

The ADD option specifies one or more directory names to be added to the current PATH, (names of the directories must be separated by at least one space). AmigaDOS searches for each of the ADDed directories. Normally, new directories are added to the end of the path. To add them to the beginning use the HEAD option.

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

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

If you omit all of the ADD, RESET and REMOVE options and provide a list of directories, the PATH command will assume that you will want to add these to the path list.

Instead of stating which directories should be added to the path right on the command line, you can also store the names of the directories in a file and let the PATH command read them. Use the FROM <filename> argument to specify the file name. That file must contain one directory name per line. Lines beginning with the ";" character will be ignored, they can be used to store comments. The file could look like this:

; directories for PATH command file example
FONTS: MyFonts:Fontdir
LIBS: SYS:Libs BigAssem:Libs PDAssem:Libs
WorkDisk: DF0: DEFER
C: DF0:C PATH
As you can see, it is possible to set up deferred and path assignments and assignment lists, too.

To complement the FROM argument there is the TO <filename> argument which will store the current list of assignments in a file, suitable for use with the FROM argument.

Example 1:

3.OS4:> PATH
Current_directory
OS4:S/Shell
OS4:S/Arexx
OS4:Utilities
OS4:Tools
OS4:Tools/Commodities
OS4:System
OS4:Prefs
OS4:WBStartup
C:
a list of directories in the search path is displayed.

Example 2:

3.OS4:> PATH EXTRAS:Tools ADD adds the Tools directory in the Extras disk to the search path of the Shell. If the EXTRAS: disk is not in a drive, a requester will ask you to insert it in any drive.

If you remove EXTRAS: from the drive and type:

3.OS4:> PATH a list of directories in the search path will be displayed. A requester will ask you to insert EXTRAS:. However, if you had typed: 3.OS4:> PATH QUIET the list of directories in the search path will be displayed, but when the path comes to Extras:Tools, only the volume name "Extras" will appear in the list.

Example 3:

3.OS4:> PATH FROM Work:Testing adds the directories found in the Testing file to the current search path.

See Also: ASSIGN


Return to Commands Selection

Disclaimer: Amiga Auckland have prepared the above Information for the use of its members based on our experiences and as such is subject to revision at any time. Amiga Auckland cannot guarantee any of the Information and cannot be held accountable for any issues that may result from using it.


Copyright 2006 Amiga Auckland Inc. All rights reserved.
Revised: February 9, 2006.