Xref: utzoo comp.unix.questions:30585 comp.unix.wizards:25028 comp.unix.internals:2583 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!exodus!appserv!angel.Eng.Sun.COM!henry From: henry@angel.Eng.Sun.COM (Henry McGilton) Newsgroups: comp.unix.questions,comp.unix.wizards,comp.unix.internals Subject: Re: Would somebody please explain? Message-ID: <552@appserv.Eng.Sun.COM> Date: 21 Apr 91 03:17:33 GMT References: <1991Apr21.001702.5661@umbc3.umbc.edu> <1991Apr21.023416.5795@mp.cs.niu.edu> Sender: news@appserv.Eng.Sun.COM Followup-To: comp.unix.questions Lines: 23 In article <1991Apr21.023416.5795@mp.cs.niu.edu>, rickert@mp.cs.niu.edu (Neil Rickert) writes: * In article <1991Apr21.001702.5661@umbc3.umbc.edu> rouben@math16.math.umbc.edu (Rouben Rostamian) writes: ** The command: ** expr "Match" : "Ma" ** returns 2, as it should, since the first two characters ** of "Match" and "Ma" coincide. Now, would somebody please ** explain why the command: ** expr "match" : "ma" ** complains of a "syntax error"? * I just ran: strings /bin/expr * From the output I would guess that 'match', 'index', 'substr' and * 'length' are builin functions or operators for 'expr', although * they are not documented in any man pages that I have seen. * I don't know the syntax for using them either. * I guess this is one of those questions to cross post to wizards. I hope not. From SunOS expr manual page (last updated 5 January 1988): ``Note: the match, substr, length, and index operators cannot themselves be used as ordinary strings.'' ........ Henry