Git Product home page Git Product logo

Comments (2)

akinomyoga avatar akinomyoga commented on June 12, 2024

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.

akinomyoga avatar akinomyoga commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.