Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!usc!apple!apple.com!rmh From: rmh@apple.com (Rick Holzgrafe) Newsgroups: comp.sys.mac.programmer Subject: Re: MPW cmd language Message-ID: <2538@internal.Apple.COM> Date: 28 Jun 89 17:17:05 GMT Sender: usenet@Apple.COM Organization: Apple Computer, Inc. Lines: 41 References:<495@unicads.UUCP> <919@iraun1.ira.uka.de> In article <919@iraun1.ira.uka.de> norbert@iraul1.ira.uka.de (Norbert Lindenberg) writes: > In article <495@unicads.UUCP> tom@unicads.UUCP (Tom Gerardy) writes: > > [...] The output of the tag tool is a string of MPW > >commands to open the file and find the search string. > >... > >Currently I am having to write the output to a file and execute it as > >a script. This seems to slow things down considerably [...] > > I [...] also could not find a better way. Probably there is none... Here's how: AddMenu Find "Find Tag/E" \ 'Set Exit 0; \ alias doit "`Findtag -a >> {WorkSheet}`"; \ (doit) > Dev:Null; \ Set Exit 1;' (Use option-d for backslash, and option-> for >.) You can't simply execute `Findtag -a >> {WorkSheet}` directly, because the Shell will take the semicolons in the output literally, rather than as command separators. But it will handle them correctly when it executes the alias. This method requires an extra layer of insulation on characters special to the shell, since escaped characters must survive both the assignment to the alias and the execution of the alias. E.g. To find a left-square bracket, Find /\[/ isn't enough; you must use Find /\\\[/ so that the [ and one of the backslashes (option-d's) survives the alias assignment. Clear as mud? :-) ========================================================================== Rick Holzgrafe | {sun,voder,nsc,mtxinu,dual}!apple!rmh Software Engineer | AppleLink HOLZGRAFE1 rmh@apple.com Apple Computer, Inc. | "All opinions expressed are mine, and do 20525 Mariani Ave. MS: 27-O | not necessarily represent those of my Cupertino, CA 95014 | employer, Apple Computer Inc."