0

Why is this not possible?

        #!/bin/bash
        for (( j=1; j<=1; j++))
        do 
            DAA_$j=`echo A`
        done

I have already read Command not found error in Bash variable assignment. But the answer I am looking for is not in there.

2
  • Generally, it's better form to ask "how can I do X?" than "why does the syntax I made up/guessed at intending that it do X (but without any supporting documentation/specification behind that assumption) not work?" Commented Nov 6, 2017 at 22:30
  • ...here, the "X" you're trying to accomplish (assigning to a variable name with a variable substituted into it) is implicit (described in your code, but never in the surrounding prose) -- but if you'd put that into your title, you might have had a duplicate presented by the site before even posting the question! Commented Nov 6, 2017 at 22:38

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.