Is it possible when I want to assign values to the correct index in array (array in bash)? when I enter some number I want that this number was on the same position as its value..
example: when I enter number 25 and then use command echo ${array[25]} I expect 25
I want to give numbers from shuf -i 1-49 -n 7 | xargs -n7 to array. Every number on his position.
Thanks for answers :)
${a[25]}just to get the value of25? It's certainly not very efficient. Imagine if Idefine array foo, then saidfoo[1000]='bar'. I'd be taking up 1001 memory locations. There might be a better way to do what you want.