In bash this works:
var1=abc
But this gives an error:
var*1=abc
var*1=abc: command not found
Why so? Why is the expression treated as a command?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
From http://www.gnu.org/software/bash/manual/bashref.html
The value on the left hand side is not an identifier. It is an expression. Therefore that command (to evaluate the entire expression) is invalid.
In other words, you can’t have asterisks in names, and you can’t generate a variable name by doing some math (multiplying).