How do I create n variables in shell scripts without explicitly assigning them?
What I mean is something like a loop that creates var1var1, var2var2, var3var3,...,varxvarx, where xx is a variable I set earlier, something like:
read x
for ((a=0;a<x;++a)); do
variable$a=${RANDOM}
done
(Let's ignore the possibility that xx might be a string for now :D)
. But obviously, this doesn't work. How would one do this?
What I actually want to do, is that each argument I wrote in the command line when I executed the script to become it's own variable ARG1ARG1, ARG2ARG2... ARGnARGn with ${1}${1}, ${2}${2},..., ${n}${n} as it'sits value, so there will only be as many of these variables, as arguments were set.
Hope you guys understand what I mean :D Thanks.