Bailey’s Big List of Escape Characters and Sequences
Escaping special characters is generally pretty straight forward, just throw the correct character in front of the problem, and it should solve itself. Sometimes it gets a bit weird though, and also sometimes it is difficult to find the correct way of doing something. I plan for this to be a live document that I update as I find things, so it will start small and grow. Feel free to comment below if you have something to add.
Nagios
Nagios has a mix of standard and weird escape sequences, and little documentation on how to handle them. As I come across each type, normal and strange, I’ll list them here.
Desired Result | Escape Sequence |
Standard escape | \ |
; | \; |
! | \! |
$ | $$ |
Batch
Definitely fewer weird situations than Nagios, but it does have a few that took a bit to find the solution to.
Desired Result | Escape Sequence |
% in a string | %% |
> in a for loop | ^> |
PowerShell
PowerShell enjoys being different and that applies to it’s escape character as well.
Desired Result | Escape Sequence |
Standard escape | ` (Grave/back tick) |
Golang
Desired Result | Escape Sequence |
Literal string | “ (Grave/back tick) |
Standard escape | \ |
helpful