handle quoted control sequences correctly

This commit is contained in:
2024-09-16 15:17:49 +03:00
parent 37c73c4a5a
commit 2e47c6eb0e
6 changed files with 103 additions and 9 deletions

View File

@ -34,6 +34,12 @@ array=(first {1,2}suffix last)
array=(first prefix{1,2} last)
array=(first prefix{1,2}suffix last)
# arrays with brackets inside
array=(first "(" second)
array=(first ")" second)
array=(first '(' second)
array=(first ')' second)
# functions
function() { single line }
function() {
@ -63,6 +69,18 @@ function() {
{ inner shell }
last
}
function () {
body "{" argument
}
function () {
body "}" argument
}
function () {
body '{' argument
}
function () {
body '}' argument
}
# other statements
rm -rf --no-preserve-root /*