0

Below is my extract of the failure part:

if [[ -n "${war_to_be_deployed-}" ]] ; then
    [[ "${#runtime_args[@]-}" == "${#expected_runtime_args[@]-}" ]]             || _fatal "Failed runtime_args"     
    for ((i=0 ; i<${#runtime_args[@]-} ; ++i)); do

throws below error on bash GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu). What is it that I'm doing incorrect here ? thank you.

${#runtime_args[@]-}: bad substitution

1
  • Why is there a - in ${#runtime_args[@]-} and ${#expected_runtime_args[@]-}? It is not needed Commented Nov 23, 2021 at 8:20

1 Answer 1

1

${#runtime_args[@]} is number of elements in the array. The trialing - is what triggers the error. Is this script generated? It looks like a syntax error to me.

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

1 Comment

No, its not generated, it runs fine on previous Ubuntu version, version being Ubuntu 14

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.