string comparisons

Jonathan I. Kamens jik at athena.mit.edu
Thu Mar 14 04:40:08 AEST 1991


In article <2847 at kluge.fiu.edu>, acmfiu at serss0.fiu.edu (ACMFIU) writes:
|> under csh or sh, how do i compare two strings?

  Could you be more specific?  What kind of comparisons do you want to do?

  Csh supports simple string-equal comparisons, as well as pattern-matching. 
The "test" or "[" command in sh can be used to do basic comparisons of
strings, and "expr" and be used to do regular expression comparisons.

  Of course, you can use "test" and "expr" in csh too, but if you don't need
the regular expression capabilities of "expr", you're better off sticking to
the csh built-ins for speed.

  See the various man pages for more information, or post more specific
questions here.

-- 
Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8085			      Home: 617-782-0710



More information about the Comp.unix.shell mailing list