Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think.com!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.shell Subject: Re: string comparisons Message-ID: <1991Mar13.184008.23466@athena.mit.edu> Date: 13 Mar 91 18:40:08 GMT References: <2847@kluge.fiu.edu> Sender: news@athena.mit.edu (News system) Organization: Massachusetts Institute of Technology Lines: 21 In article <2847@kluge.fiu.edu>, acmfiu@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@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8085 Home: 617-782-0710