Skip to main content
added 205 characters in body
Source Link
user001
  • 3.8k
  • 6
  • 43
  • 55

Note that -eq is for integer comparisons. For string comparisons, use == (or =). Thus, you should use the following:

if test "$suman_inspect" == "yes"; then
    # do something
fi

YouThe same distinction applies for inequality operators (-gt, -lt, -ge, -le, and -ne being used for numerical comparisons, and >, <, >=, <=, and != being used for string comparisons).

Note that you can also use [ expression ] in place of test expression; the two are synonymous.

Note that -eq is for integer comparisons. For string comparisons, use == (or =). Thus, you should use the following:

if test "$suman_inspect" == "yes"; then
    # do something
fi

You can also use [ expression ] in place of test expression; the two are synonymous.

Note that -eq is for integer comparisons. For string comparisons, use == (or =). Thus, you should use the following:

if test "$suman_inspect" == "yes"; then
    # do something
fi

The same distinction applies for inequality operators (-gt, -lt, -ge, -le, and -ne being used for numerical comparisons, and >, <, >=, <=, and != being used for string comparisons).

Note that you can also use [ expression ] in place of test expression; the two are synonymous.

added 183 characters in body
Source Link
user001
  • 3.8k
  • 6
  • 43
  • 55

Note that -eq is for integer comparisons. For string comparisons, use == (or =). Thus, you should use the following:

if test "$suman_inspect" == "yes"; then
    # do something
fi

You can also use [ expression ] in place of test expression; the two are synonymous.

Note that -eq is for integer comparisons. For string comparisons, use ==.

Note that -eq is for integer comparisons. For string comparisons, use == (or =). Thus, you should use the following:

if test "$suman_inspect" == "yes"; then
    # do something
fi

You can also use [ expression ] in place of test expression; the two are synonymous.

Source Link
user001
  • 3.8k
  • 6
  • 43
  • 55

Note that -eq is for integer comparisons. For string comparisons, use ==.