Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't escape closing brace with backslash or single quotes in parameter expansion #702

Closed
Crestwave opened this issue Apr 8, 2020 · 1 comment

Comments

@Crestwave
Copy link
Contributor

Crestwave commented Apr 8, 2020

Required for #679; thought I was done, but running it on my other computer triggered this. The latter is probably #291, but the former seems to be another (possibly related) issue; backslash escaping does work with other characters.

$ var='$foo'
$ echo "${var#$foo}"
$foo
$ echo "${var#\$foo}"

$ var='}'
$ echo "${var#}}"
}}
$ echo "${var#\}}"

$ echo "${var#'}'}"

$ echo "${var#"}"}"
osh$ var='$foo'
osh$ echo "${var#$foo}"
$foo
osh$ echo "${var#\$foo}"

osh$ var='}'
osh$ echo "${var#}}"
}}
osh$ echo "${var#\}}"
}}
osh$ echo "${var#'}'}"
}'}
osh$ echo "${var#"}"}"

@andychu andychu mentioned this issue Apr 15, 2020
5 tasks
andychu pushed a commit that referenced this issue Apr 15, 2020
- spec/glob: #698
- spec/var-op-strip: #702

Reported by Crestwave.
andychu pushed a commit that referenced this issue Apr 15, 2020
Fixes issue #702.

This was a side effect of fixing #695 with commit 84c2r4.
@andychu
Copy link
Contributor

andychu commented Apr 15, 2020

Fixed at the same time as #291! woohoo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants