Intentions of BashSupport Pro
BashSupport Pro provides intentions to help you change common aspects of shell scripts efficiently.
Convert to Quoted String
Convert a single-quoted string like 'text'
or a plain, unquoted word like text
into an equivalent double-quoted string.
- Kontext
- Single-quoted strings and unquoted text.
![Vor 'Convert to quoted string'](/pngs/intentions/shConvertToQuotedString_400.b50520de2a0bd4918da27663d90bc812.png)
![Nach 'Convert to quoted string'](/pngs/intentions/shConvertToQuotedString_after_400.943db1f2222efd6dbf6b954674e23580.png)
Convert to Raw String
Convert a double-quoted string into an equivalent single-quoted string.
- Kontext
- Double-quoted strings, which only contain static values. String with variable references, subshells or other dynamic content are excluded from this intention.
![Vor 'Convert to raw string'](/pngs/intentions/shConvertToRawString_400.7cc972d190839c77565c197319b831b9.png)
![Nach 'Convert to raw string'](/pngs/intentions/shConvertToRawString_after_400.c923992ea761a5b37af79a5d7e702565.png)
Convert to Unquoted Literal
Convert a single-quoted or double-quoted string into a text literal without quotes. Special characters are escaped, when needed.
- Kontext
- Single quoted and double-quoted strings.
![Vor 'Convert to unquoted literal'](/pngs/intentions/shConvertToUnquotedString_400.fd8de0239f9c7d3698244fdfb8e240d2.png)
![Nach 'Convert to unquoted literal'](/pngs/intentions/shConvertToUnquotedString_after_400.f129437671ec1df87944879aaf9b9829.png)
Convert to Legacy `...` Notation
Convert a subshell command into the equivalent backquote command.
Both ()
and $()
are converted into ``
.
- Kontext
- Subshell commands.
![Vor 'Convert to legacy `...` notation'](/pngs/intentions/shConvertToBackquote_400.cc4f2193a4b1c66f4234a852e15f1a9e.png)
![Nach 'Convert to legacy `...` notation'](/pngs/intentions/shConvertToBackquote_after_400.f67aa08ed7cfdb172371db64bcb9d72b.png)
Convert to $(...) Notation
Convert a legacy backquote command substitution `` element into the equivalent subshell element.
- Kontext
- Legacy backquote commands
![Vor 'Convert to $(...) notation'](/pngs/intentions/shConvertToSubshell_400.b7fbef5e40b282e18dadae6e925ea1e8.png)
![Nach 'Convert to $(...) notation'](/pngs/intentions/shConvertToSubshell_after_400.1f30a2eb173b75faa3be106598fab028.png)
Escape String
Adds escaping to a string to turn variable references into literal string values. Please note, that this changes the semantics of the escaped text.
- Kontext
- Double-quoted strings.
![Vor 'Escape string'](/pngs/intentions/shEscapeString_400.04cde8fed1d95ea8b5cd9198f6197e79.png)
![Nach 'Escape string'](/pngs/intentions/shEscapeString_after_400.aa1d3166541fe6422225310a19926ca5.png)
Remove String Escaping
Removes escaping from a quoted string. Please note, that this intention may change the semantics of your script.
- Kontext
- Double-quoted strings or single-quoted strings like
$'text'
, which support escapes.
![Vor 'Remove string escaping'](/pngs/intentions/shUnescapeString_400.177171a52e99bd932ad14fcd36249174.png)
![Nach 'Remove string escaping'](/pngs/intentions/shUnescapeString_after_400.1fac1ef7225262aa2bddc81f6034ac11.png)
Convert to Variable Reference $Name
Converts a simple parameter expansion ${name}
into the equivalent variable reference $name
.
- Kontext
- Simple parameter expansions without operators.
![Vor 'Convert to variable reference $name'](/pngs/intentions/shExpansionToVar_400.8c3cb4ec60f03fa0be2c587c919d3c63.png)
![Nach 'Convert to variable reference $name'](/pngs/intentions/shExpansionToVar_after_400.6afb9b84727e36f07ed8f1691453aa5a.png)
Convert to Parameter Expansion ${Name}
Converts a simple variable reference into the equivalent parameter expansion.
![Vor 'Convert to parameter expansion ${name}'](/pngs/intentions/shVarToExpansion_400.1b857f45f6b846f137e278cf99f70f15.png)
![Nach 'Convert to parameter expansion ${name}'](/pngs/intentions/shVarToExpansion_after_400.663f0a9041b85095c41caf0002f7c083.png)
Add Function Keyword
Adds a function keyword to functions declared in Bash files.
- Kontext
- Names of function definitions without the
function
keyword.
![Vor 'Add function keyword'](/pngs/intentions/shFunctionKeywordAdd_400.4271a2ca0a92ed0dcb77a576ba3ed122.png)
![Nach 'Add function keyword'](/pngs/intentions/shFunctionKeywordAdd_after_400.d70db9af3f333e17cf33349e60426d4b.png)
Remove Function Keyword
Removes the function keyword of function declarations.
- Kontext
- The
function
keyword of function definitions.
![Vor 'Remove function keyword'](/pngs/intentions/shFunctionKeywordRemove_400.6c124c586155d53483fd8300a7f404de.png)
![Nach 'Remove function keyword'](/pngs/intentions/shFunctionKeywordRemove_after_400.2a54ecb701e6a04d35888250742b43e8.png)
Remove Quotes (May Change Semantics)
Remove the quote of single-quoted or double-quoted strings. Only the quotes are removed, no escaping or other transformations are applied. Please note, that this intention may change the semantics of your script.
- Kontext
- Single-quoted and double-quoted strings.
![Vor 'Remove quotes (may change semantics)'](/pngs/intentions/shRemoveStringQuotes_400.f75498d47c6b3fd1b6703f2b8d659091.png)
![Nach 'Remove quotes (may change semantics)'](/pngs/intentions/shRemoveStringQuotes_after_400.e71fd319191cf78916d13a802e4bb11c.png)
Switch Bats-Core Test Marker Style
Switch between @test
and #@test
marker styles of bats-core.
- Kontext
- Names of bats-core test functions or the test markers
@test
and#@test
.
![Vor 'Switch bats-core test marker style'](/pngs/intentions/shBatsCoreTestStyle_400.03c641347c72298089ed48b131d530fe.png)
![Nach 'Switch bats-core test marker style'](/pngs/intentions/shBatsCoreTestStyle_after_400.47b4d05f391b2615f5f6a7f39fc1cb29.png)