ksh (back)ticks, or how I learned to stop worrying and love the $()
Channel: noob2dev
Date: 2022-01-18

Just an amusing video about how weird some ksh stuff is.

To recap:
To escape a backtick for a literal backtick, it needs to be preceded by 2^(n+1)-1 backslashes, where n is how many backtick command substitution levels deep you are.
For escaping backticks for nested command substitution, you need 2^(n-1)-1 backslashes in front of it.
Escaping backslashes needs 2^(n+1) backslashes for a single backslash.
Escaping $ needs 2^(n+1)-1 backslashes in front of it, unless it can't be interpreted as a substitution, in which case you don't need any.