Intentions of BashSupport Pro
BashSupport Pro provides intentions to help you change common aspects of shell scripts efficiently.
转换为带引号字符串
Convert a single-quoted string like 'text'
or a plain, unquoted word like text
into an equivalent double-quoted string.
- 上下文
- Single-quoted strings and unquoted text.
![在'转换为带引号字符串'之前](/pngs/intentions/shConvertToQuotedString_400.b50520de2a0bd4918da27663d90bc812.png)
![在'转换为带引号字符串'之后](/pngs/intentions/shConvertToQuotedString_after_400.943db1f2222efd6dbf6b954674e23580.png)
转换为原始字符串
Convert a double-quoted string into an equivalent single-quoted string.
- 上下文
- Double-quoted strings, which only contain static values. String with variable references, subshells or other dynamic content are excluded from this intention.
![在'转换为原始字符串'之前](/pngs/intentions/shConvertToRawString_400.7cc972d190839c77565c197319b831b9.png)
![在'转换为原始字符串'之后](/pngs/intentions/shConvertToRawString_after_400.c923992ea761a5b37af79a5d7e702565.png)
转换为无引号文字
Convert a single-quoted or double-quoted string into a text literal without quotes. Special characters are escaped, when needed.
- 上下文
- Single quoted and double-quoted strings.
![在'转换为无引号文字'之前](/pngs/intentions/shConvertToUnquotedString_400.fd8de0239f9c7d3698244fdfb8e240d2.png)
![在'转换为无引号文字'之后](/pngs/intentions/shConvertToUnquotedString_after_400.f129437671ec1df87944879aaf9b9829.png)
转换为传统的 `...` 符号
Convert a subshell command into the equivalent backquote command.
Both ()
and $()
are converted into ``
.
- 上下文
- Subshell commands.
![在'转换为传统的 `...` 符号'之前](/pngs/intentions/shConvertToBackquote_400.cc4f2193a4b1c66f4234a852e15f1a9e.png)
![在'转换为传统的 `...` 符号'之后](/pngs/intentions/shConvertToBackquote_after_400.f67aa08ed7cfdb172371db64bcb9d72b.png)
转换为 $(...) 符号
Convert a legacy backquote command substitution `` element into the equivalent subshell element.
- 上下文
- Legacy backquote commands
![在'转换为 $(...) 符号'之前](/pngs/intentions/shConvertToSubshell_400.b7fbef5e40b282e18dadae6e925ea1e8.png)
![在'转换为 $(...) 符号'之后](/pngs/intentions/shConvertToSubshell_after_400.1f30a2eb173b75faa3be106598fab028.png)
转义字符串
Adds escaping to a string to turn variable references into literal string values. Please note, that this changes the semantics of the escaped text.
- 上下文
- Double-quoted strings.
![在'转义字符串'之前](/pngs/intentions/shEscapeString_400.04cde8fed1d95ea8b5cd9198f6197e79.png)
![在'转义字符串'之后](/pngs/intentions/shEscapeString_after_400.aa1d3166541fe6422225310a19926ca5.png)
删除字符串转义
Removes escaping from a quoted string. Please note, that this intention may change the semantics of your script.
- 上下文
- Double-quoted strings or single-quoted strings like
$'text'
, which support escapes.
![在'删除字符串转义'之前](/pngs/intentions/shUnescapeString_400.177171a52e99bd932ad14fcd36249174.png)
![在'删除字符串转义'之后](/pngs/intentions/shUnescapeString_after_400.1fac1ef7225262aa2bddc81f6034ac11.png)
转换为变量引用 $Name
Converts a simple parameter expansion ${name}
into the equivalent variable reference $name
.
- 上下文
- Simple parameter expansions without operators.
![在'转换为变量引用 $name'之前](/pngs/intentions/shExpansionToVar_400.8c3cb4ec60f03fa0be2c587c919d3c63.png)
![在'转换为变量引用 $name'之后](/pngs/intentions/shExpansionToVar_after_400.6afb9b84727e36f07ed8f1691453aa5a.png)
=转换为变量展开 ${Name}
Converts a simple variable reference into the equivalent parameter expansion.
![在'=转换为变量展开 ${name}'之前](/pngs/intentions/shVarToExpansion_400.1b857f45f6b846f137e278cf99f70f15.png)
![在'=转换为变量展开 ${name}'之后](/pngs/intentions/shVarToExpansion_after_400.663f0a9041b85095c41caf0002f7c083.png)
添加函数关键字
Adds a function keyword to functions declared in Bash files.
- 上下文
- Names of function definitions without the
function
keyword.
![在'添加函数关键字'之前](/pngs/intentions/shFunctionKeywordAdd_400.4271a2ca0a92ed0dcb77a576ba3ed122.png)
![在'添加函数关键字'之后](/pngs/intentions/shFunctionKeywordAdd_after_400.d70db9af3f333e17cf33349e60426d4b.png)
移除 Function 关键字
Removes the function keyword of function declarations.
- 上下文
- The
function
keyword of function definitions.
![在'移除 function 关键字'之前](/pngs/intentions/shFunctionKeywordRemove_400.6c124c586155d53483fd8300a7f404de.png)
![在'移除 function 关键字'之后](/pngs/intentions/shFunctionKeywordRemove_after_400.2a54ecb701e6a04d35888250742b43e8.png)
删除引号(可能会改变语义)
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.
- 上下文
- Single-quoted and double-quoted strings.
![在'删除引号(可能会改变语义)'之前](/pngs/intentions/shRemoveStringQuotes_400.f75498d47c6b3fd1b6703f2b8d659091.png)
![在'删除引号(可能会改变语义)'之后](/pngs/intentions/shRemoveStringQuotes_after_400.e71fd319191cf78916d13a802e4bb11c.png)
切换 Bats-Core 测试标记样式
Switch between @test
and #@test
marker styles of bats-core.
- 上下文
- Names of bats-core test functions or the test markers
@test
and#@test
.
![在'切换 bats-core 测试标记样式'之前](/pngs/intentions/shBatsCoreTestStyle_400.03c641347c72298089ed48b131d530fe.png)
![在'切换 bats-core 测试标记样式'之后](/pngs/intentions/shBatsCoreTestStyle_after_400.47b4d05f391b2615f5f6a7f39fc1cb29.png)