4

Anyone know how to fix "Simple use of array variables" in BASH?

for instance:

# will complain $paths[@] is a simple array variable
for path in "${paths[@]}"; do 
    [ ! -d "${path}" ] && mkdir -p "${path}"
done

I have about 10 notices in my code I would like to take care of

1 Answer 1

9

This looks like a bug in bashsupport for IDEA / PHPStorm / etc.

It seems that the code only checks for arithmetic expressions between the brackets, so paths[1+2] works but paths[@] does not as it is no arithmetic expression.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.