idank / idank/explainshell

Misidentification of arithmetic expansions

Open
#109 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
14.2k
Forks
851
PR merge metrics
No merged PRs in 30d

Description

Where the bash(1) reads

       ((expression))
              The expression is evaluated according  to  the  rules  described
              below  under ARITHMETIC EVALUATION.  If the value of the expres‐
              sion is non-zero, the return status is 0; otherwise  the  return
              status is 1.  This is exactly equivalent to let "expression".

explainshell gives this instead:

       (list) list  is  executed in a subshell environment (see COMMAND EXECU‐
              TION ENVIRONMENT below).  Variable assignments and builtin  com‐
              mands  that  affect  the  shell's  environment  do not remain in
              effect after the command completes.  The return  status  is  the
              exit status of list.

It's a great project btw. :)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the explainshell example command and compare its classification with the bash(1) manual text quoted in the issue. Trace how (( foo )) is parsed and matched against the arithmetic-expansion documentation versus (list), then verify that the example is identified correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.