|
| | | | P A T M A T
| | | | |
patmat-0.1
-----------
---
This little proggy allows to use AmigaOS patterns for path and/or file
resolving where this feature is not available. Main purpose of this program
is to help implement path/file level pattern matching in scripts.
---
NOTES:
[*]
Requires 68020(no FPU)+, OS2.04(theoretically)+, 6+ kilos of free memory.
[*]
Please note that no 'NameFromLock()' is ever called in order to resolve
path elements thus denested paths(like 'foo/bar///baz' => '//') will not be
resolved at all. I do not consider this a problem since it does not matter
what directory will be visited during trip to the final object.
[*]
Environment variable $RC will be set to 5 whenever element is not a part of
filesystem. Also OBJECT/A will be printed to the output intact.
[*]
For your convinience i did rip a text from NDK that describes all available
tokens:
? Matches a single character.
# Matches the following expression 0 or more times.
(ab|cd) Matches any one of the items seperated by '|'.
~ Negates the following expression. It matches all strings that do
not match the expression(aka ~(foo) matches all strings that are
not exactly "foo").
[abc] Character class: matches any of the characters in the class.
[~bc] Character class: matches any of the characters not in the class.
a-z Character range(only within character classes).
% Matches 0 characters always(useful in "(foo|bar|%)").
* Synonym for "#?", not available by default in 2.0. Available as
an option that can be turned on.
---
HELP:
> patmat ?
OBJECT/A,Q=QUOTE/K
OBJECT/A - Pathname/filename to be pattern matched. Each path element
can contain patterns.
Q=QUOTE/K - Character(s) to be used as quotes around the OBJECT/A.
---
USAGE:
; Instead of typing full name you can run 'ScreenMode' like this
run `patmat sys:prefs/sc#?e q "*""`
; Suppose that some directory contains other directories that do
; recurse really deep(first/second/third/fourth/fifth/sixth) and
; each directory is lonesome
patmat first/*/*/*/*/*
; Match the very first object in temporary directory given it is
; not a Command-#? file
patmat T:~(Command-#?)
---
megacz
| |
| | | | |
|