Xref: utzoo comp.unix.questions:30682 comp.unix.wizards:25096 comp.unix.internals:2612 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!think.com!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!slxsys!ibmpcug!demon!cliff From: cliff@demon.co.uk (Cliff Stanford) Newsgroups: comp.unix.questions,comp.unix.wizards,comp.unix.internals Subject: Re: Would somebody please explain? Summary: Undocumented Use of /bin/expr Message-ID: <1991Apr22.230906.9239@demon.co.uk> Date: 22 Apr 91 23:09:06 GMT References: <1991Apr21.001702.5661@umbc3.umbc.edu> <1991Apr21.023416.5795@mp.cs.niu.edu> Organization: Demon Systems Limited Lines: 33 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. > Well I'm blowed! All those work although I've not seen any documentation for any one of them. (SCO 3.2.2) Input Output ----- ------ expr match abcde abc 3 expr index abcde cd 3 expr length abcde 5 expr substr abcde 2 3 bcd Why doesn't anyone DOCUMENT unix? Cliff. -- Cliff Stanford Email: cliff@demon.co.uk (Work) Demon Systems Limited cms@demon.co.uk (Home) 42 Hendon Lane Phone: 081-349 0063 (Office) London N3 1TT England 0860 375870 (Mobile)