most likely a typo for the redirection (&>2 is >&2)

Otherwise it is creating a '2' file where it addresses the echo message.

Closes #19740.

PiperOrigin-RevId: 572209172
Change-Id: I378decfda2d8f91badfe18df408e495783c63529
diff --git a/src/test/shell/integration/target_compatible_with_test.sh b/src/test/shell/integration/target_compatible_with_test.sh
index 19dc829..2b0c674 100755
--- a/src/test/shell/integration/target_compatible_with_test.sh
+++ b/src/test/shell/integration/target_compatible_with_test.sh
@@ -558,7 +558,7 @@
     name = "genrule_foo1",
     target_compatible_with = [":foo1"],
     outs = ["foo1.sh"],
-    cmd = "echo 'Should not be executed' &>2; exit 1",
+    cmd = "echo 'Should not be executed' >&2; exit 1",
 )
 
 sh_binary(