I'm having a small problem with bash shell script on assigning the values from command line to the arrays. For Example if i type $./test.sh aa bb cc
i want the values to be assigned to arrays E.g
test[0]=aa
test[1]=bb
test[2]=cc
and it should be limitless, it has to create arrays according to user input.
This is my code
Thank You
#!/usr/bin/bash
count2=1
declare -a mvne $count2
while [ $# -gt $count2 ]
do
mvne[$count2]=$"[$count2]" <---here is the problem, how do i assign the command line parameter to the array
echo ${mvne[$count2]}
count2=`expr $count2 + 1`
done