Xref: utzoo comp.sys.amiga:19220 comp.sys.amiga.tech:810 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: <5732@cup.portal.com> Date: 21 May 88 20:56:01 GMT References: <8805092047.AA18301@cory.Berkeley.EDU> <1974@sugar.UUCP> <5490@cup.portal.com> <2027@sugar.UUCP> Organization: The Portal System (TM) Lines: 48 XPortal-User-Id: 1.1001.4407 I write: > 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. Peter da Silva writes: >If you want to use it just for command line arguments, anyway. In the latest >version of Browser I use it to select groups of files. Yes...I got it from an old Browser, actually. Just for the record, of course *you* put a wrapper around it too...for the benefit of everyone else, what's going on is that Jeff's code allows you to compare a string against a pattern and see if they match. It has no awareness of directories, filenames, full paths, etc. Hence the wrapper. For a Workbench-based program, one might not need all of the full-path-wildcard features I felt obligated to put into Glob()...expanding just the current directory is sufficient, and much simpler. >I used to use "buildav(&ac, &av)", but really you need to change _main >to do the globbing for command line args invisibly, and to provide an analog >of Examine/ExNext. The best way to implement that would be to duplicate the >name of and interface to Manx' "scdir()". Be my guest. I was going to do all >of that stuff, but I'd be as happy to let you. Actually that's two separate interfaces you're talking about. For enhancing _main(), you could just call the Glob(&ac, av) routine I was talking about, and your command line gets wildcard expanded. The second one is the scdir() you suggest, which would also be useful for some purposes...like to drop into code that was previously using ExNext() with minimum hassle. Question: does scdir() handle patterns like "#?/#?/#?" or is it just current directory? The Manx documentation doesn't say. BTW Manx's scdir() implements Unix style wildcards, while everything that Peter and I are talking about is AmigaDOS style. I'll probably do an scdir() equivalent next time I do a program that needs it. :-) >How about "del foo#(.o)" to trash foo and foo.o when you're cleaning house? >The # can be used to indicate optional parts of a pattern (tho of course >del foo(|.o) should work as well). Ok, thanks. Someone else tells me that "del foo(%|.o)" is also equivalent. Makes me wonder what the point of having '%' is...esthetics? Doug --- Doug Merritt ucbvax!sun.com!cup.portal.com!doug-merritt or ucbvax!eris!doug (doug@eris.berkeley.edu) or ucbvax!unisoft!certes!doug