Xref: utzoo comp.sys.amiga:18958 comp.sys.amiga.tech:748 Path: utzoo!attcan!uunet!portal!cup.portal.com!doug-merritt From: doug-merritt@cup.portal.com Newsgroups: comp.sys.amiga,comp.sys.amiga.tech Subject: Re: CLI/shells Message-ID: <5490@cup.portal.com> Date: 16 May 88 18:01:59 GMT References: <8805092047.AA18301@cory.Berkeley.EDU> <1974@sugar.UUCP> Organization: The Portal System (TM) Lines: 40 XPortal-User-Id: 1.1001.4407 Peter da Silva said: >'*' also has the disadvantage that it conflicts with AmigaDOS usage [...] >It's already overloaded. # is the standard. Please stick to it. There is >an excellent wildcard handler witten by Jeff Lydiatt that I use extensively. >[...] I use "#?.(c|h)|Makefile" quite a bit when moving programs around. It's >equivalent to the csh "{*.[ch],Makefile}" It also allows string alternation, like unix egrep: "(main|misc).#?" which is real handy! Jeff's code is very nice, and very easy to interface to. I suspect that the reason that Jeff's code hasn't been used more extensively is that you've got to put a good wrapper around it. I did so this weekend for my "filetype" program, and it was a few hundred lines of code to make it 100% perfectly general. To search the current directory only requires maybe 10-20 lines of code (foreach dir entry, check whether it matches via Jeff's code). Handling *every* possible case, with error checking, is more complex. But I was real pleased to see "filetype #?/#?/#?" work. I was thinking about releasing this code I wrote as a library routine. The interface looks like this: "av = Glob(&ac, av);" Pretty simple, eh? Anyone need something like this? Is there already something like this around that I somehow overlooked? Even if there is, there's one feature I added that I'd bet is unique... it wildcards *devices* too! I.e. "filetype #?:#?" matches the contents of all the root directories on all the file system devices (and assigns). This required surprisingly little extra code on top of the original stuff. I'm feeling real pleased to have gotten this working nicely. I do have one (dumb) question, though. For some reason I can't find the wildcard documentation in the AmigaDOS manual. Where is it? I wanna know what the magic char "%" is for. And to refresh my memory about uses of '#' other than '#?'. Pretty bad when some dummy doesn't even know what the code he implements does, huh. (blush) :-) Doug Merritt ucbvax!sun.com!cup.portal.com!doug-merritt or ucbvax!eris!doug (doug@eris.berkeley.edu) or ucbvax!unisoft!certes!doug