next up previous contents
Next: Testing Files Up: Bourne Shell Programming Previous: Testing and Branching

String Comparisons

Strings are considered to be equal if each character in one is matched exactly in the other, and they have the same length. For example the following strings are not equal: String is not equal to String. While the strings contain the same letters, the second string contains an extra space, and they are therefore not equal. All of the string tests supported by test are listed in table 2.5.

Table 2.5:  String tests supported by test.

Douglas M Gingrich
Mon Apr 27 15:25:49 MDT 1998