Showing changes from revision #1 to #2:
Added | Removed | Changed
<< Part 2 | Index ^^ | Part 4 >>
Several commands (including *Copy) allow you to specify more than one file by using a wildcard in the filename. The available wildcards are:
* | Match 0 or more characters |
# | Match one character |
For example, example:
Fred*
would match “Fred”, “Freda”, “Freddy”, “Frederick”, “Freda” … and “Frederick”; andFred#
would match “Fred2” and “Freda” but not “Fred” “Fred”, “Freddy” or “Frederick”. “Frederick”;
Fred##
would match “Freddy” but not “Fred”, “Freda” or “Frederick”.
RISC OS contains a number of system devices, which can be used in place of filenames if you want to send (or receive) data to/from somewhere other than a file:
kbd: | The keyboard, reading a line at a time |
rawkbd: | The keyboard, reading a character at a time |
vdu: | The screen |
rawvdu: | The screen, bypassing GSRead conversion |
serial: | The serial port |
printer: | The printer |
null: | The null device, which discards all output |
For example, you can use the *Copy command to send a file to the printer:
*Copy MyFile printer:
Alternatively, you may want to run a command but are not interested in any screen output. This can be done by redirecting output to the null device device: as follows:
*MyCommand { > null: }
For a full list of system devices, see SystemDevices Technical Details.
Command aliases were mentioned in CLI Basics part 2. Another special type of alias is used to declare the default action to be taken on encountering a filetype. These take the following forms:
Alias$LoadType_XXX |
Specifies the action to be taken when a file of type XXX (in hexadecimal) is loaded |
Alias$RunType_XXX |
Specifies the action to be taken when a file of type XXX is run |
Most of these declarations are only of use in the desktop, but a handful are also relevant while in the
relevant while in the CLI. For example, the default settings for filetype FFE are:
Alias$RunType_FFE Exec %0
which means that, if a file of type FFE is entered as a command at the star prompt, the action taken will be to *Exec the file.
The way RISC OS searches for files or commands is controlled by the system variables File$Path and RunPath, as follows:
File$Path |
The list of directories that RISC OS searches when looking for a file. |
Run$Path |
The list of directories that RISC OS searches when looking for a program to run. |
Each entry in the path contains a directory name followed by a full stop. Entries are separated by commas; two commas in a row are treated as a null entry (i.e. the currently selected directory, also known as CSD). Hence a run path of Boot:Library.,,%.
would cause “Boot:Library” to be searched first, followed by CSD and finally “%” (i.e. the current library). library directory).
There are occasions when you may want to change these settings. For example, if you wanted RISC OS to search $.MyLibrary
in addition to the other directories in Run$Path, you might use: @*Set Run$Path <Run$Path>,$.MyLibrary.*Set Run$Path <Run$Path>,$.MyLibrary.
For more information on File$Path and Run$Path, see FileSwitch Paths To Search For Files.