I am learning shell sripting and got stuck. here is the code #!/bin/bash
a=0
myarray[$a]=$1
echo $myarray[$a]
((a+=1))
echo $a
Output:
#./varcheck sa
sa[0]
1
somebody please tell me why the name of array is getting replaced with argument that I want to assign to 0th index of array.