shell-escape
Invicton-Labs/shell-escape/null
Terraform Shell Escape This module escapes a string for use in either a Unix shell or Windows PowerShell. It will always escape the following characters: - Newline literal -> ``` \n `` (Unix), `` n ``` (PowerShell) - Carriage return literal -> (removed for Unix), `` r ``` (PowerShell) - Tab literal -> `` \t `` (Unix), `` \t `` (PowerShell) - `` ``` -> `` \ ``` (Unix), `` `` (PowerShell) - " -> `` \" `` (Unix), `` " ``` (PowerShell) - $ -> `` \$ `` (Unix), `` $ ``` (PowerShell) For Unix, it will also escape: - \ -> `` \\ `` Usage ` module "shell-escape" { source = "Invicton-Labs/shell-escape/null" string = <<EOF This is a multi-line string. This line is indented with a tab. Here are "double quotes", and here are backticks. We also have a couple dollar signs ($$$). EOF } output "escaped_stri
| Name | Type | Description | Default |
|---|---|---|---|
| string | string | The string to escape. | required |
| powershell_replace_unix_escape_sequences | bool | Whether to replace Unix escape sequences with escaped versions of the PowerShell | false |
| unix_replace_powershell_escape_sequences | bool | Whether to replace Powershell escape sequences with escaped versions of the Unix | false |
unix — The Unix-escaped string.powershell — The PowerShell-escaped string.