Multiple choice technology operating systems

How could you check if two strings are equal?

  1. test $a -eq $b
  2. test $a -equal $b
  3. test $a = $b
  4. sh -c test $a == $b
Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In shell test commands, = is used for string comparison. Options A and B use numeric operators (-eq, -equal), and D has incorrect syntax. Option C: test $a = $b correctly tests if two strings are equal.