#!/bin/bash echo "Testing different SSH command patterns..." echo "" # What coordinator currently does (BROKEN): echo "=== Test 1: Single quotes (current) ===" ssh root@10.10.254.106 ssh root@10.20.254.100 'echo test1 > /tmp/test1.txt && cat /tmp/test1.txt' echo "Exit code: $?" echo "" # What should work (double-nested quotes): echo "=== Test 2: Double-nested quotes ===" ssh root@10.10.254.106 "ssh root@10.20.254.100 'echo test2 > /tmp/test2.txt && cat /tmp/test2.txt'" echo "Exit code: $?" echo "" # Verify which files were created: echo "=== Checking which test files exist ===" ssh root@10.10.254.106 "ssh root@10.20.254.100 'ls -la /tmp/test*.txt 2>/dev/null || echo \"No test files found\"'"