Comments (2)
Thanks for the report. Originally the check for the quoting in the arithmetic context was implemented for Bash 4.3. However, the behavior of Bash seems to have changed. After your report, I have made comprehensive tests for quoting in the arithmetic context. Here are the behavioral differences of different quoting between different contexts and Bash versions, where the check mark indicates that the quoting is supported:
COMMAND | 3.0..4.3 | 4.4..5.0 | 5.1 | 5.2..dev |
---|---|---|---|---|
echo $((\10)) |
⬜ | ⬜ | ⬜ | ⬜ |
echo $(('10')) |
⬜ | ⬜ | ⬜ | ⬜ |
echo $(($'10')) |
⬜ | ⬜ | ⬜ | ⬜ |
echo $(("10")) |
⬜ | ✅ | ✅ | ✅ |
echo $(($"10")) |
⬜ | ✅ | ✅ | ✅ |
echo $((a[\10])) |
✅ | ⬜ | ⬜ | ⬜ |
echo $((a["10"])) |
✅ | ✅ | ✅ | ✅ |
echo $((`echo 10`)) |
✅ | ✅ | ✅ | ✅ |
echo $[\10] |
⬜ | ⬜ | ⬜ | ⬜ |
echo $['10'] |
⬜ | ⬜ | ⬜ | ⬜ |
echo $[$'10'] |
⬜ | ⬜ | ⬜ | ⬜ |
echo $["10"] |
⬜ | ✅ | ✅ | ✅ |
echo $[$"10"] |
⬜ | ✅ | ✅ | ✅ |
echo $[a[\10]] |
✅ | ⬜ | ⬜ | ⬜ |
echo $[a["10"]] |
✅ | ✅ | ✅ | ✅ |
echo $[`echo 10`] |
✅ | ✅ | ✅ | ✅ |
((\10)) |
✅ | ✅ | ⬜ | ⬜ |
(('10')) |
✅ | ✅ | ⬜ | ⬜ |
(($'10')) |
✅ | ✅ | ⬜ | ⬜ |
(("10")) |
✅ | ✅ | ✅ | ✅ |
(($"10")) |
✅ | ✅ | ✅ | ✅ |
((a[\10])) |
✅ | ✅ | ⬜ | ⬜ |
((a["10"])) |
✅ | ✅ | ✅ | ✅ |
((`echo 10`)) |
✅ | ✅ | ✅ | ✅ |
b[\10]= |
✅ | ⬜ | ⬜ | ⬜ |
b['10']= |
✅ | ⬜ | ⬜ | ⬜ |
b[$'10']= |
✅ | ⬜ | ⬜ | ⬜ |
b["10"]= |
✅ | ✅ | ✅ | ✅ |
b[$"10"]= |
✅ | ✅ | ✅ | ✅ |
b[a[\10]]= |
✅ | ⬜ | ⬜ | ⬜ |
b[a["10"]]= |
✅ | ✅ | ✅ | ✅ |
b[`echo 10`]= |
✅ | ✅ | ✅ | ✅ |
: ${b[\10]} |
✅ | ⬜ | ⬜ | ⬜ |
: ${b['10']} |
✅ | ⬜ | ⬜ | ⬜ |
: ${b[$'10']} |
✅ | ⬜ | ⬜ | ⬜ |
: ${b["10"]} |
✅ | ✅ | ✅ | ✅ |
: ${b[$"10"]} |
✅ | ✅ | ✅ | ✅ |
: ${b[a[\10]]} |
✅ | ⬜ | ⬜ | ⬜ |
: ${b[a["10"]]} |
✅ | ✅ | ✅ | ✅ |
: ${b[`echo 10`]} |
✅ | ✅ | ✅ | ✅ |
b=([\10]=) |
✅ | ✅ | ✅ | ✅ |
b=(['10']=) |
✅ | ✅ | ✅ | ✅ |
b=([$'10']=) |
✅ | ✅ | ✅ | ✅ |
b=(["10"]=) |
✅ | ✅ | ✅ | ✅ |
b=([$"10"]=) |
✅ | ✅ | ✅ | ✅ |
b=([a[\10]]=) |
✅ | ✅ | ✅ | ✅ |
b=([a["10"]]=) |
✅ | ✅ | ✅ | ✅ |
b=([`echo 10`]=) |
✅ | ✅ | ✅ | ✅ |
: ${v:\10} |
⬜ | ⬜ | ⬜ | ⬜ |
: ${v:'10'} |
⬜ | ⬜ | ⬜ | ⬜ |
: ${v:$'10'} |
⬜ | ⬜ | ⬜ | ⬜ |
: ${v:"10"} |
⬜ | ⬜ | ⬜ | ✅ |
: ${v:$"10"} |
⬜ | ⬜ | ⬜ | ✅ |
: ${v:a[\10]} |
✅ | ⬜ | ⬜ | ⬜ |
: ${v:a["10"]} |
✅ | ✅ | ✅ | ✅ |
: ${v:`echo 10`} |
✅ | ✅ | ✅ | ✅ |
: "${v:\10}" |
⬜ | ⬜ | ⬜ | ⬜ |
: "${v:'10'}" |
⬜ | ⬜ | ⬜ | ⬜ |
: "${v:$'10'}" |
✅ | ✅ | ✅ | ✅ |
: "${v:"10"}" |
⬜ | ⬜ | ⬜ | ✅ |
: "${v:$"10"}" |
⬜ | ⬜ | ⬜ | ✅ |
: "${v:a[\10]}" |
✅ | ⬜ | ⬜ | ⬜ |
: "${v:a["10"]}" |
✅ | ✅ | ✅ | ✅ |
: "${v:`echo 10`}" |
✅ | ✅ | ✅ | ✅ |
The behavior also depends on shopt -s extquote
.
from ble.sh.
I've supported the Bash-version dependent checking in commit 611c1d9. (For a few contexts, I gave up a perfect implementation for older versions of Bash.) Could you update ble.sh by running the command ble-update
and check the behavior?
from ble.sh.
Related Issues (20)
- [kitty] Hangs on exit HOT 42
- kitty is unable to determine that prompt is starting HOT 11
- I don't want BLE to change my terminal colors. How do i do that? HOT 11
- vim insert mode: `C-RET` doesn't work for multiline commands HOT 6
- tab completion quotes weird chars by surrounding with single quotes, menu selection with backslash escapes HOT 10
- How to write completion functions to work with or without ble.sh? HOT 4
- highlighted text no longer deleted HOT 4
- Don't automatically trigger completions for certain directories HOT 2
- Notify users when overwriting options? HOT 8
- [wezterm, vim-airline] lualine over cursor HOT 4
- yy copies a newline in front of the line HOT 2
- Recent versions have cache update status presistently showing up HOT 12
- [macOS, iTerm2] Ctrl+d does not exit, disables backspace HOT 3
- [ncurses 6.1] ctrl+l and clear not working properly HOT 12
- Unable to set ble-face `syntax_function_name` HOT 7
- Source ble.sh each time when restart a console will increase the time cost. HOT 15
- expanding abbreviations that are the results of completions HOT 1
- [SUSE /etc/inputrc] issues sourcing ble.sh HOT 18
- [WSL] ble.sh breaks on start and does not let me type in the console HOT 40
- Several questions about ble.sh usage HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ble.sh.