Bash Quote Escaping

Here is how the number of backslashes needed to escape quotes increases as you embed them deeper :

ssh -A jumphost.example.com "
  ssh -A inner.jumphost.example.com \"
    ssh target.example.com \\\"
      hostname;
      echo \\\\\\\"it takes 15 backslashes to print the \\\\\\\\\\\\\\\" character when you're 4 levels in\\\\\\\"
    \\\"
  \"
"
Level Backslashes
0 0
1 1
2 3
3 7
4 15
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.