[comp.sys.amiga.tech] Wildcards

peter@sugar.hackercorp.com (Peter da Silva) (03/13/90)

We have on one side the folks saying "I can't trust programmers to put
	wildcard matching into programs".

We have on the other side the folks saying "I can't trust programmers to
	properly quote shell arguments".

Perhaps the solution is to have a syntax in the shell that says "expand
these wildcards yourself":

1> set quotewild=on
1> frobnitz [#?.bork]	; This expands #?.bork in the shell.
1> frobnitz #?.bork	; This depends on frobnitz to do the expansion.
1> set quotewild=off
1> frobnitz #?.bork	; Now it expands #? in the shell.
1> set wildcards=unix
1> frobnitz *.bork	; For the folks who don't like pure closures.

Scripts would probably run with quotewild on by default, and the more powerful
amiga-style wildcards, and interactive shells would turn quotewild off and use
the terser unix-style wildcards.
-- 
 _--_|\  Peter da Silva <peter@sugar.hackercorp.com>.
/      \
\_.--._/ I haven't lost my mind, it's backed up on tape somewhere!
      v  "Have you hugged your wolf today?" `-_-'

daveh@cbmvax.commodore.com (Dave Haynie) (03/14/90)

In article <5383@sugar.hackercorp.com> peter@sugar.hackercorp.com (Peter da Silva) writes:
>We have on one side the folks saying "I can't trust programmers to put
>	wildcard matching into programs".

>We have on the other side the folks saying "I can't trust programmers to
>	properly quote shell arguments".

>Perhaps the solution is to have a syntax in the shell that says "expand
>these wildcards yourself":

That's actually not a bad solution -- programs often don't want the shell to expand
wildcards (DiskSalv for one, which wants the pattern passed in unexpanded, to match
against anything it finds on the disk).  Yet, for most operations, who's actually
expanding the wildcards isn't an issue, at least until the shell runs into command-line
length restrictions (like csh does all the time for me when I'm ZOOing things under
UNIX) or the command doesn't have built-in expansion (like ZOO under AmigaDOS).

Hopefully AmigaOS V1.4 will help out here with an extended and built-in wildcard
parser.  However, if anyone's interested in basic matching of standard AmigaDOS
wildcards, I'll make the routines used by DiskSalv available.  They compile under
Lattice V5.02, but confuse the optimizer.  They're less than 1K or so of code, and
pretty easy to use.  

> _--_|\  Peter da Silva <peter@sugar.hackercorp.com>.
>/      \
>\_.--._/ I haven't lost my mind, it's backed up on tape somewhere!
>      v  "Have you hugged your wolf today?" `-_-'


-- 
Dave Haynie Commodore-Amiga (Systems Engineering) "The Crew That Never Rests"
   {uunet|pyramid|rutgers}!cbmvax!daveh      PLINK: hazy     BIX: hazy
                    Too much of everything is just enough

addison@pollux.usc.edu (Richard Addison) (03/15/90)

In article <10142@cbmvax.commodore.com> daveh@cbmvax (Dave Haynie) writes:
>or the command doesn't have built-in expansion (like ZOO under AmigaDOS).

Nitpick:  ZOO has some built-in expansion.  That is, it will match a
wildcard against a filename but not against a directory name.  Thus, all
subdirectories have to be explicitly specified:  subdir/*.   Yes, I
know, this can be a pain for ZOOing a directory with a lot of branches,
especially if they go several levels down.

One thing I've noticed about the ZOO version I use on the Amiga:  When
the current directory has hundreds of files, ZOO seems to look at the
directory entries of all of them even when I do something like:

	ZOO v foo.zoo

That is, it thrashes around for quite a while before getting down to
business.  Now, if I CD Ram: first and then try:

	ZOO v DH0:BigDir/foo.zoo

it does not thrash around.  Why?

--Rich

duncant@mbunix.mitre.org (Thomson) (03/15/90)

In article peter@sugar.hackercorp.com (Peter da Silva) writes:

...good ideas about wildcards omitted...
>
>Scripts would probably run with quotewild on by default, and the more powerful
>amiga-style wildcards, and interactive shells would turn quotewild off and use
>the terser unix-style wildcards.

|I am surprised at the use of the phrase "more powerful amiga-style wildcards".
More powerful than what?  Everything you can do with # and ? you can doo
with * and ?, not jsut on unix, but also on VMS and (to some extent) on DOS.
Note that VMS also allows a "wildcard" mechanism in path sepcifications, not
just file names, so you can do much more flexible searches of directory trees
for example.

I never understood where the AmigaDos wildcard conventions came from.  Why 
deviate from a widely used convention in favor of a new one which noone is familiar with?

Personnally, I hope that the Amiga "#?" strangeness fades away with 1.4 and
later releases.

Last, I have written a short routine name_match( pattern, string) which tests 
whether the string matches a pattern, which may contain arbitrary * and ?
wild cards.  I also use in my own programs a convention that "..."  in a
path means "this directory and any subdirectories leading off it".  This
would be handy to have as a standard Amiga convention, so that I could do 
   COPY vol:dir/dir.../*foo?ar.* destination
instead of ....  how Would you do this under DOS?

Duncan Thomson

--
(Please excuse the typos and garbage caused by line noise.)

d88-skl@nada.kth.se (Stellan Klebom) (03/15/90)

In article <102618@linus.UUCP> duncant@mbunix.mitre.org (Thomson) writes:
>In article peter@sugar.hackercorp.com (Peter da Silva) writes:
>
>...good ideas about wildcards omitted...
>>
>>Scripts would probably run with quotewild on by default, and the more powerful
>>amiga-style wildcards, and interactive shells would turn quotewild off and use
>>the terser unix-style wildcards.
>
>|I am surprised at the use of the phrase "more powerful amiga-style wildcards".
>More powerful than what?  Everything you can do with # and ? you can doo
>with * and ?, not jsut on unix, but also on VMS and (to some extent) on DOS.
>Note that VMS also allows a "wildcard" mechanism in path sepcifications, not
>just file names, so you can do much more flexible searches of directory trees
>for example.

The power of # is that you can apply it on an arbitrary regular expression.
That means that you for example can do dir #(Match|Me). And matching files
like "MatchMatchMatch","MatchMatchMatchMe","MeMatchMeMatchMatch", etc.
Now tell me how you can do that in UNIX or VMS? :-)

>I never understood where the AmigaDos wildcard conventions came from.  Why 
>deviate from a widely used convention in favor of a new one which noone is familiar with?

Neither can I, but I find Amiga DOS wilcards quite good. I just wish they
had made it like Apollo's.

>Personnally, I hope that the Amiga "#?" strangeness fades away with 1.4 and
>later releases.

I don't!! :-)

>Last, I have written a short routine name_match( pattern, string) which tests 
>whether the string matches a pattern, which may contain arbitrary * and ?
>wild cards.  I also use in my own programs a convention that "..."  in a
>path means "this directory and any subdirectories leading off it".  This
>would be handy to have as a standard Amiga convention, so that I could do 
>   COPY vol:dir/dir.../*foo?ar.* destination
>instead of ....  how Would you do this under DOS?

Well, here is the weakness of AmigaDos wildcards. The ... notation is missing.
I certainly hope for it in KS1.4.

>Duncan Thomson
>
>--
>(Please excuse the typos and garbage caused by line noise.)


        Stellan

-------------------------------------------------------------------------------
E-Mail: UUNET: d88-skl@nada.kth.se      * #include <std-disclaimer.h>
	UUCP:  uunet!sunic!nada!d88-skl *
                                        * You'll never now,
Snail-Mail: Stellan Klebom              * tomorrow may be cancelled!
            Axvaegen 6                  *
            S-175 44 JAERFAELLA         *
            SWEDEN                      * (Yet another intelligent statement)
-------------------------------------------------------------------------------

mwm@raven.pa.dec.com (Mike (Real Amiga have keyboard garages) Meyer) (03/16/90)

In article <3138@draken.nada.kth.se> d88-skl@nada.kth.se (Stellan Klebom) writes:

   In article <102618@linus.UUCP> duncant@mbunix.mitre.org (Thomson) writes:
   >I never understood where the AmigaDos wildcard conventions came from.  Why 
   >deviate from a widely used convention in favor of a new one which noone 
   >is familiar with?

   Neither can I, but I find Amiga DOS wilcards quite good. I just wish they
   had made it like Apollo's.

#, ?, () & | come from Tripos, along with the CLI and the rest of the
DOS. I was familiar with it over 10 years ago, and it's nearly 15
years old.

   >   COPY vol:dir/dir.../*foo?ar.* destination
   >instead of ....  how Would you do this under DOS?


Yup, the "..." notation is missing from DOS. And from most things.
That and the "*" notation is an addition to VMS since I last used it -
"*" used to be restricted oddly, so that "xy*zy" wouldn't work.

	<mike
--
Take a magic carpet to the olden days			Mike Meyer
To a mythical land where everybody lays			mwm@relay.pa.dec.com
Around in the clouds in a happy daze			decwrl!mwm
In Kizmiaz ... Kizmiaz

mrush@csuchico.edu (Matt Rush) (03/16/90)

In article <102618@linus.UUCP> duncant@mbunix.mitre.org (Thomson) writes:
>In article peter@sugar.hackercorp.com (Peter da Silva) writes:
>
>...good ideas about wildcards omitted...
>>
>>Scripts would probably run with quotewild on by default, and the more powerful
>>amiga-style wildcards, and interactive shells would turn quotewild off and use
>>the terser unix-style wildcards.
>
>|I am surprised at the use of the phrase "more powerful amiga-style wildcards".
>More powerful than what?  Everything you can do with # and ? you can doo
>with * and ?, not jsut on unix, but also on VMS and (to some extent) on DOS.
	True, * and ? are about equivalent to # and ?.  HOWEVER, there are OTHER
wildcard symbols in AmigaDOS.  Many people, I find, have never used the |  or
parentheses.
	If you have the AmigaDOS reference manual (Bantam Books) READ about the
wildcards and you'll see that MS-DOG sucks compared to AmigaDOS wildcards.

	Try  copy <filename>.(c|h) ram:  and you can save a lot of time when
duplicating source files...

>I never understood where the AmigaDos wildcard conventions came from.
	Neitherr have I :-)

>Duncan Thomson
>
>--
>(Please excuse the typos and garbage caused by line noise.)
	Likewise, my terminal has a bunch of dead keys  :-(
	-- Matt

daveh@cbmvax.commodore.com (Dave Haynie) (03/16/90)

In article <23494@usc.edu> addison@pollux.usc.edu (Richard Addison) writes:
>In article <10142@cbmvax.commodore.com> daveh@cbmvax (Dave Haynie) writes:
>>or the command doesn't have built-in expansion (like ZOO under AmigaDOS).

>Nitpick:  ZOO has some built-in expansion.  That is, it will match a
>wildcard against a filename but not against a directory name.  Thus, all
>subdirectories have to be explicitly specified:  subdir/*.   Yes, I
>know, this can be a pain for ZOOing a directory with a lot of branches,
>especially if they go several levels down.

Nitpick back at ya: under AmigaDOS, "*" isn't a wildcard.  In any case,
it sounds like part of the problem with programs accepting wildcards in
general: it takes work on the part of the programmer.  Some of the 
compilers out there have very simple-minded pattern matching functions;
probably where ZOO got it's "*".  Under UNIX, the shell expands the 
wildcards, so that's not really a problem with UNIX zoo (though UNIX
runs into a different problem -- the normal command-line buffer is too
short for many of the multi-level archives I've built.  That's a good
argument for program expansion vs. shell expansion in this case).

>That is, it thrashes around for quite a while before getting down to
>business.  Now, if I CD Ram: first and then try:

>	ZOO v DH0:BigDir/foo.zoo

>it does not thrash around.  Why?

It sure sounds like it's creating some temporary files in the current
directory, which is probably a UNIX-ism.  It would work better in the 
general case if, when making temporary files, it put them in "T:", the
proper place for temporary files on the Amiga.

>--Rich


-- 
Dave Haynie Commodore-Amiga (Systems Engineering) "The Crew That Never Rests"
   {uunet|pyramid|rutgers}!cbmvax!daveh      PLINK: hazy     BIX: hazy
                    Too much of everything is just enough

daveh@cbmvax.commodore.com (Dave Haynie) (03/16/90)

In article <102618@linus.UUCP> duncant@mbunix.mitre.org (Thomson) writes:
>In article peter@sugar.hackercorp.com (Peter da Silva) writes:

>>Scripts would probably run with quotewild on by default, and the more powerful
>>amiga-style wildcards, and interactive shells would turn quotewild off and use
>>the terser unix-style wildcards.

>|I am surprised at the use of the phrase "more powerful amiga-style wildcards".
>More powerful than what?  Everything you can do with # and ? you can doo
>with * and ?, not jsut on unix, but also on VMS and (to some extent) on DOS.

Really?  I think you should read up on AmigaDOS wildcards (and probably UNIX
too).  Using just * and ?, please construct a single pattern that meets
these requirements:

	MATCH			DON'T MATCH

	Foo.Bar			Fxx.Bxr
	Foo.Baar		Fx.Bxxxr
	Fo.Baaar

The answer, in AmigaDOS-speak, using only the # and ? metacharacters (which
is an absurd example, since most interesting cases, rather than this 
carefully constructed on, often use at the (, ), and | metacharacters):

	F#o.B#ar

You can make a pattern that'll match that in UNIX, but not with your
restricted set of * and ? only.

>I never understood where the AmigaDos wildcard conventions came from.  

Well, TriPos, basically.  But the logic behind it is that, rather than
simple wildcards, you have a reasonable regular expression language.
The "*" convention would be a waste of a metacharacter.  The one that's
missing (but hopefully in 1.4) is a negation character.

>Why deviate from a widely used convention in favor of a new one which 
>noone is familiar with?

Only the degenerate case of *? is widely used, and even then, the actual
meaning varies between systems.  If you don't believe that, try just *
under Apollo's DomainOS/Aegis sometime.  The obvious answer to your
question, of course, is the standard one: new conventions are adpoted
because they are considered better.  That's why I traded my C128 for an
Amiga in the first place, why I program in C or C++ most of the time 
rather than BASIC, why I find a GUI occasionally useful even though it's
not as "widely used" as a command-line interface.  Etc.

>Duncan Thomson

-- 
Dave Haynie Commodore-Amiga (Systems Engineering) "The Crew That Never Rests"
   {uunet|pyramid|rutgers}!cbmvax!daveh      PLINK: hazy     BIX: hazy
                    Too much of everything is just enough

daveh@cbmvax.commodore.com (Dave Haynie) (03/16/90)

In article <MWM.90Mar15110039@raven.pa.dec.com> mwm@raven.pa.dec.com (Mike (Real Amiga have keyboard garages) Meyer) writes:
>In article <3138@draken.nada.kth.se> d88-skl@nada.kth.se (Stellan Klebom) writes:

>Yup, the "..." notation is missing from DOS. And from most things.
>That and the "*" notation is an addition to VMS since I last used it -
>"*" used to be restricted oddly, so that "xy*zy" wouldn't work.

VMS is still oddly restricted.  In many cases, you actually have to
type "*.*;*" to match everything in a directory, whereas you'd simply
type "*" under UNIX, "#?" under AmigaDOS, or "?*" in Apollo-OS.  I
suppose the MessyDOS user would be required to type "*.*".  Aren't
universal wildcards consistent?  At least with AmigaDOS, you know right
away you're dealing with something different.  The worst mistakes can be
made by using a convention that's ALMOST like what you knew elsewhere.

>	<mike


-- 
Dave Haynie Commodore-Amiga (Systems Engineering) "The Crew That Never Rests"
   {uunet|pyramid|rutgers}!cbmvax!daveh      PLINK: hazy     BIX: hazy
                    Too much of everything is just enough

mwm@raven.pa.dec.com (Mike (Real Amiga have keyboard garages) Meyer) (03/17/90)

In article <10210@cbmvax.commodore.com> daveh@cbmvax.commodore.com (Dave Haynie) writes:

   Well, TriPos, basically.  But the logic behind it is that, rather than
   simple wildcards, you have a reasonable regular expression language.
   The "*" convention would be a waste of a metacharacter.  The one that's
   missing (but hopefully in 1.4) is a negation character.

This brings up a point that has always annoyed me about Unix. It's got
regular expression languages all over the place - ed, vi, sed, grep,
awk, and others. They _all_ use the same basic languages, and many
Eunices even have a library to provide these facilities, so that you
get the same language everywhere.

Except for file name globbing. There, "*" changes from meaning "zero
or more of the previous pattern" to "zero or more of '?'", and the "."
character becomes "?". This always seemed like a violation of the rule
of least surprise.

This should go on my 1.4 (1.5? 2.0?) wish list - that all standard
commands that might want to deal with patterns accept the same regular
expression language, and that filename wildcarding match that. It'd
also be nice if the '#' operator moved to behind the expression where
it belongs, but that's a minor nit.

	<mike



--
Teddies good friend has his two o'clock feast		Mike Meyer
And he's making Teddies ex girl friend come		mwm@relay.pa.dec.com
They mistook Teddies good trust				decwrl!mwm
Just for proof that Teddy was dumb.

grx1042@uoft02.utoledo.edu (Steve Snodgrass) (03/18/90)

In article <10209@cbmvax.commodore.com>, daveh@cbmvax.commodore.com (Dave Haynie) writes:
> In article <23494@usc.edu> addison@pollux.usc.edu (Richard Addison) writes:
>>That is, it thrashes around for quite a while before getting down to
>>business.  Now, if I CD Ram: first and then try:
> 
>>	ZOO v DH0:BigDir/foo.zoo
> 
>>it does not thrash around.  Why?
> 
> It sure sounds like it's creating some temporary files in the current
> directory, which is probably a UNIX-ism.  It would work better in the 
> general case if, when making temporary files, it put them in "T:", the
> proper place for temporary files on the Amiga.

Actually, what is happening is when you do a:

Zoo v file

Zoo for some reason appends an * onto file.  I guess this is supposed to be a
feature that lets you type only a partial name, i.e. if you have a file:

whatchamacallit.zoo

You only have to type "zoo v what" and it will work.  On the other hand, if you
include the ".zoo" in your filename, zoo will not add the *.  Thus, without the
".zoo" it ends up searching the whole directory structure, thrashing the disk,
whereas with the ".zoo" it just goes straight to that file.

/\=====================================================================/\
\/ Reality: Steve Snodgrass  |"Hand over hand/Doesn't seem so much/    \/
/\  -^-^- Cyberspace -^-^-   | Hand over hand/Is the strength of the   /\
\/ GRX1042@uoft02.utoledo.edu| common touch" -Rush, Hand Over Fist     \/
/\ GRX1042@uoft02.BITNET     |"If it's broke, send it back.  If it     /\
\/ uoft02::GRX1042 (DECnet)  | works, take it apart and find out why." \/

peter@sugar.hackercorp.com (Peter da Silva) (03/19/90)

In article <102618@linus.UUCP> duncant@mbunix.mitre.org (Thomson) writes:
> I am surprised at the use of the phrase "more powerful amiga-style wildcards".
> More powerful than what?

More powerful than on UNIX. The Amiga wildcards provide a complete
implementation of regular expressions, with closures. UNIX wildcards
don't.

Suppose you want to match all file names ending with .c, .h, or .bak, and
beginning with an underscore or "ck" or containing the string "test".

In UNIX, you have to use several expressions:

	_*.[ch] _*.bak ck*.[ch] ck*.bak *test*.[ch] *test*.bak

On the Amiga, you have a single expression:

	((_|ck)#?|#?test#?).(c|h|bak)

Or you can do the same thing in egrep:

	\(\(_|ck\).*|.*test.*\).\([ch]|bak\)

The Amiga wildcards are more complex, but they're also a lot more powerful.

> I never understood where the AmigaDos wildcard conventions came from.

The syntax is unconventional, but the use of a closure rather than a wildcard
has been around for a long time.
-- 
 _--_|\  Peter da Silva <peter@sugar.hackercorp.com>.
/      \
\_.--._/ I haven't lost my mind, it's backed up on tape somewhere!
      v  "Have you hugged your wolf today?" `-_-'

deven@rpi.edu (Deven T. Corzine) (03/19/90)

In article <102618@linus.UUCP> duncant@mbunix.mitre.org (Thomson) writes:

Thomson> I am surprised at the use of the phrase "more powerful
Thomson> amiga-style wildcards".  More powerful than what?

On 18 Mar 90 18:55:35 GMT, peter@sugar.hackercorp.com (Peter da Silva) said:

Peter> Suppose you want to match all file names ending with .c, .h, or
Peter> .bak, and beginning with an underscore or "ck" or containing
Peter> the string "test".

Peter> In UNIX, you have to use several expressions:

Peter> 	_*.[ch] _*.bak ck*.[ch] ck*.bak *test*.[ch] *test*.bak

For csh users:  {_,ck,*test}*.{[ch],bak}

Peter> On the Amiga, you have a single expression:

Peter> 	((_|ck)#?|#?test#?).(c|h|bak)

Peter> The Amiga wildcards are more complex, but they're also a lot
Peter> more powerful.

AmigaDOS's (x|y|z) syntax is directly analogous to csh's {x,y,z}.

Thomson> I never understood where the AmigaDos wildcard conventions
Thomson> came from.

Peter> The syntax is unconventional, but the use of a closure rather
Peter> than a wildcard has been around for a long time.

Granted, AmigaDOS wildcards are flexible and powerful, but I find them
less convenient to use than Unix wildcards, under most circumstances.
While it is mor flexible to be able to match foo and foooo with f#o,
it's not something I find myself using on any regular basis.

What is more difficult, for example, is the fact that the copy program
only accepts a single source and single destination argument.  Yes,
you can do "copy (foo|bar|baz) dir" instead of "copy foo bar baz dir",
but the former notation is more cumbersome to type, and introduces
another disadvantage, namely that it is a _wildcard_.

This means the entire directory must be scanned for matches.  You lose
the speed advantage of the hashed directory lookups, and pay the
penalty for a directory scan, even if you know exactly what files you
want to copy.  The only way to avoid this is to run the copy program
once for each program to be copied.  This is also inconvenient.  The
problem is most noticable if you want to copy a half dozen or so files
from a LARGE directory on a floppy.  My C: directory takes on the
order of 20-30 seconds to scan (maybe longer) and it should not be
necessary for a simple list of files.

I realize that this problem can be solved by using a different copy
program which accepts arguments in a fashion more like that of Unix
cp.  That's not the point.  The point is that in _practice_, the
flexible wildcards which AmigaDOS offer are not necessarily the boon
they may seem.  They are awkward to use, and can shift focus from some
strengths of AmigaDOS (hashed lookups) to some weaknesses (directory
scans).

As for solutions, accepting multiple filename arguments instead of a
single one in places like the copy program would be an improvement.

In response to Dave Haynie's note that "*" has special meaning to
AmigaDOS:  point taken.  But there are times it can be determined from
context whether "*" should be the console or a wildcard.  Of course,
there are situations where it is indeterminable.  Offering the user a
configurable option of whether or not to treat "*" as a wildcard, and
permit it to be escaped with \ or even *.  That is, in a wildcard
context, treat "*" as "#?" and "**" as "*".  Thoughts?

Deven
-- 
Deven T. Corzine        Internet:  deven@rpi.edu, shadow@pawl.rpi.edu
Snail:  2151 12th St. Apt. 4, Troy, NY 12180   Phone:  (518) 274-0327
Bitnet:  deven@rpitsmts, userfxb6@rpitsmts     UUCP:  uunet!rpi!deven
Simple things should be simple and complex things should be possible.

peter@sugar.hackercorp.com (Peter da Silva) (03/19/90)

> Peter> In UNIX, you have to use several expressions:

> Peter> 	_*.[ch] _*.bak ck*.[ch] ck*.bak *test*.[ch] *test*.bak

> For csh users:  {_,ck,*test}*.{[ch],bak}

> AmigaDOS's (x|y|z) syntax is directly analogous to csh's {x,y,z}.

No, it isn't. In most cases it can be used the same way, but it's not
identical.

The csh {,} syntax is parsed before wildcarding is done. It's not really
an alternation operator, like the Amiga (|) syntax supports. For example,
expanding {core,*.o} will produce the string "core" whether or not there
is a file matching that pattern. This can be useful, but it's not the same
thing. Also, as other people have pointed out, there's still no closure
operator. How about all file names of the form cx followed by any number
of digits?

	cx#(0|1|2|3|4|5|6|7|8|9)

Also, of course, it's not available in scripts.

> Granted, AmigaDOS wildcards are flexible and powerful, but I find them
> less convenient to use than Unix wildcards, under most circumstances.

Which is why my original message, that started this whole chain off, suggested
using UNIX wildcards interactively and the more powerful Amiga wildcards in
scripts.

That suggestion, by the way, was that *all* uses of wildcards be marked
explicitly, and all arguments not marked as wildcards not be wildcarded.
On the Amiga, for example, anything not enclosed in parentheses would be
treated literally.

Anyway, Deven, get back to coding up Amigix & quit wasting time on News. :->
-- 
 _--_|\  Peter da Silva <peter@sugar.hackercorp.com>.
/      \
\_.--._/ I haven't lost my mind, it's backed up on tape somewhere!
      v  "Have you hugged your wolf today?" `-_-'

daveh@cbmvax.commodore.com (Dave Haynie) (03/20/90)

In article <MWM.90Mar16132806@raven.pa.dec.com> mwm@raven.pa.dec.com (Mike (Real Amiga have keyboard garages) Meyer) writes:
>In article <10210@cbmvax.commodore.com> daveh@cbmvax.commodore.com (Dave Haynie) writes:

>This should go on my 1.4 (1.5? 2.0?) wish list - that all standard
>commands that might want to deal with patterns accept the same regular
>expression language, and that filename wildcarding match that. 

That's an excellent idea, something that will hopefully be real easy for
anyone writing a program as long as the pattern matching routines are
available as a function call.  There should be no excuse on any machine
for 4 or 5 different and possibly contradictory ways of doing the same
very simple operation.

>It'd also be nice if the '#' operator moved to behind the expression 	where
>it belongs, but that's a minor nit.

I wondered about that one too, first.  But it does make the language more
orthogonal; this way, all unary operators are post-fix.  Most people are 
uncomfortable with quote or negation operators as pre-fix, and won't be
bothered by # being where it is, even if it's not exactly what a mathematician
would expect.

>	<mike



-- 
Dave Haynie Commodore-Amiga (Systems Engineering) "The Crew That Never Rests"
   {uunet|pyramid|rutgers}!cbmvax!daveh      PLINK: hazy     BIX: hazy
                    Too much of everything is just enough

daveh@cbmvax.commodore.com (Dave Haynie) (03/20/90)

In article <DEVEN.90Mar19071609@netserv2.rpi.edu> deven@rpi.edu (Deven T. Corzine) writes:

>In response to Dave Haynie's note that "*" has special meaning to
>AmigaDOS:  point taken.  But there are times it can be determined from
>context whether "*" should be the console or a wildcard.  

I agreed with the use of "|" as a pipe character in WShell for the same basic
reason, once WShell was taught that "thing | thing" should mean pipe, while
"thing|thing" should mean pattern alternation.  

>Of course, there are situations where it is indeterminable.  Offering the 
>user a configurable option of whether or not to treat "*" as a wildcard, 
>and permit it to be escaped with \ or even *.  

Well, then, how about a general facility in the shell to add read macros.
Then you get the system in standard form, but if you want, add a read macro
that converts "*" to "#?" at the shell level.  Of course, what you really
want is such a facility below the shell level, so the same conversions take
place in file requesters or any other place wild card expansion (at least
when provided via standard system calls) takes place.

>Deven

-- 
Dave Haynie Commodore-Amiga (Systems Engineering) "The Crew That Never Rests"
   {uunet|pyramid|rutgers}!cbmvax!daveh      PLINK: hazy     BIX: hazy
                    Too much of everything is just enough

rosenber@ra.abo.fi (Robin Rosenberg INF) (03/20/90)

>VMS is still oddly restricted.  In many cases, you actually have to      
>type "*.*;*" to match everything in a directory, whereas you'd simply    
>type "*" under UNIX, "#?" under AmigaDOS, or "?*" in Apollo-OS.  I       
>suppose the MessyDOS user would be required to type "*.*".  Aren't      
>universal wildcards consistent?  At least with AmigaDOS, you know right 
>away you're dealing with something different.  The worst mistakes can be
>made by using a convention that's ALMOST like what you knew elsewhere.
                                  ^^^^^^
You mean like messydos. vs unix. I am used to *t8.* meaning all files with
thes string 't8.' somewhere in the name. I once had a lot of such files
on a Messydos machine. All files with 't8.' in their name were deleted...

...As well as all other files in that same directory. 'ALMOST' as unix.

--------
Robin Rosenberg

rusty@fe2o3.UUCP (Rusty Haddock) (03/21/90)

In article <10211@cbmvax.commodore.com> daveh@cbmvax (Dave Haynie) writes:
   >In article <MWM.90Mar15110039@raven.pa.dec.com> mwm@raven.pa.dec.com (Mike (Real Amiga have keyboard garages) Meyer) writes:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- You got that one right Mikey! :-}

   >...
   >VMS is still oddly restricted.  In many cases, you actually have to
   >type "*.*;*" to match everything in a directory, whereas you'd simply
   >type "*" under UNIX, "#?" under AmigaDOS, or "?*" in Apollo-OS.  I
   >suppose the MessyDOS user would be required to type "*.*".  Aren't
   >universal wildcards consistent?

Well, they would be if filenames were always just a long string of
characters.  Under Unix and AmigaDOS, filenames are not composed of
various "fields" such as filename, extension, and revision number
(ala VMesS).  Unix file names are simply strings (length limited by
the OS filesystem) of eight-bit bytes.  Any sort of "extensions"
(e.g. .c, .o, .f, and .s) are either generally accepted conventions or
desired by not-so-liberal compilers.  Thusly, "visual separators"
such as a period are no more different in a filename than the letter
A or the number 6.

Under ugly and awkward beasts [for me anyhow] such as VMesS and
MesS-DOS filename are composed of fields enforced by the file system
or O/S.  VMesS has filenames broken up into fields and the wildcards
only apply to a given field.  The period (and VMesS's semicolon) are
not "really" quite part of the filename (at least not how I look at
them). 

If I remember right, under IBM's VM file names have three parts also;
a filename, extension, and disk letter(?).  As best I can remember,
file specifications used whitespace to separate the fields (and not
periods).

And does anyone remember TRS-DOS??  :-} Didn't it use slashes (/) to
separate filename and extension? 

Oh well, back to my cage....

			-Rusty-
-- 
Rusty Haddock		o  {uunet,rutgers}!mimsy.umd.edu!fe2o3!rusty
Laurel, Maryland	o  rusty%fe2o3@mimsy.umd.edu
    -=> This .signature protected by Smith & Wesson <=-

usenet@cps3xx.UUCP (Usenet file owner) (03/23/90)

In article <3138@draken.nada.kth.se> d88-skl@nada.kth.se (Stellan Klebom) writes:
>In article <102618@linus.UUCP> duncant@mbunix.mitre.org (Thomson) writes:
[...]
>>wild cards.  I also use in my own programs a convention that "..."  in a
>>path means "this directory and any subdirectories leading off it".  This
>>would be handy to have as a standard Amiga convention, so that I could do 
>>   COPY vol:dir/dir.../*foo?ar.* destination
>>instead of ....  how Would you do this under DOS?
>
>Well, here is the weakness of AmigaDos wildcards. The ... notation is missing.

I don't think it would be that useful and some programs could abuse it.
What I think is needed is the ability to copy to the current directory.
For example, "copy file" to copy a file to the current directory.  Or is
there already some way of doing this?

[...]
>>Duncan Thomson
[...]
>        Stellan

  /\    from
 /  \_________________________________
/ /\  Chris Dailey, Amiga Enthusiast /
\ \ \___dailey@cpsin1.cps.msu.edu___/
 \  /
  \/

new@udel.edu (Darren New) (03/24/90)

In article <7002@cps3xx.UUCP> dailey@cpsin2.UUCP (Chris Dailey) writes:
>For example, "copy file" to copy a file to the current directory.  Or is
>there already some way of doing this?

Yes, you can do this already.  Even in 1.2, the empty string meant the
current directory, so you could always Lock("", ACCESS___). However, the
copy command in 1.2 would not special-case it, so if you said
   copy file ""
then copy would see that "" is a directory, tack on "/file" and copy
it, leaving you in the parent dir.  Under 1.3, copy seems to special-case
the empty string, so
   copy file ""
will copy the file to the current directory.
I would have thought TriPos, as a Ph.D. dissertation(sp?), would have
been careful to make the semantics match the syntax.   I once worked
out a real nice scheme for this, but I've never gotten around to
writing a filesystem :-)             -- Darren

deven@rpi.edu (Deven T. Corzine) (11/09/90)

On 4 Nov 90 17:36:09 GMT, limonce@pilot.njin.net (Tom Limoncelli) said:

Tom> As more and more people get 2.0, we will finally see the demise
Tom> of the "why not use * for wilde cards?  I hate to type #? !"

No, Tom...  People can still bitch about it -- for * to be equivalent
to #?, it has to be in conjunction with something, not alone.  That
is, you can do "delete *.o" but not "delete *"...  However, you *can*
use "delete **" instead, so I guess it's not *too* bad...  (People
just have to be made aware doubling it works for a match-everything
wildcard...  yes, it's still 2 keystrokes, like #?, but both the same
key, and one many people are used to...)

Tom> The end of an era.

So much the pity...

Deven
-- 
Deven T. Corzine        Internet:  deven@rpi.edu, shadow@pawl.rpi.edu
Snail:  2214 12th St. Apt. 2, Troy, NY 12180   Phone:  (518) 271-0750
Bitnet:  deven@rpitsmts, userfxb6@rpitsmts     UUCP:  uunet!rpi!deven
Simple things should be simple and complex things should be possible.

ppessi@niksula.hut.fi (Pekka Pessi) (11/11/90)

>>>>> On 8 Nov 90 22:33:12 GMT, deven@rpi.edu (Deven T. Corzine) said:
Deven> No, Tom...  People can still bitch about it -- for * to be equivalent
Deven> to #?, it has to be in conjunction with something, not alone.  That
Deven> is, you can do "delete *.o" but not "delete *"...  However, you *can*
Deven> use "delete **" instead, so I guess it's not *too* bad...  (People
Deven> just have to be made aware doubling it works for a match-everything
Deven> wildcard...  yes, it's still 2 keystrokes, like #?, but both the same
Deven> key, and one many people are used to...)

	The first thing I did with my Amiga was to customize the "S"
	keymap. In so called Swedish/Finnish keymap you should press
	shift-alt-3 to get #, which is quite ridiculous. I mapped
	string "#?"  to alt-` (and # to shift-#). So where is your 2
	keystrokes? If machine have customizeable keymaps, why not to
	use them?  If some program insists to use usa1, toss it to
	trashcan.

						Pekka Pessi