Bash arrays
First off inside bash arrays ,elements are separated by space.
Have a look at this.
$cat new.sh
length=1
positions=(0 1 2)
positions[length+1]=4
echo "${positions[*]}"
./new.sh
0 1 4
Point to note is that 'length' as well as '$length' areboth valid indexes.
Have a look at this.
$cat new.sh
length=1
positions=(0 1 2)
positions[length+1]=4
echo "${positions[*]}"
./new.sh
0 1 4
Point to note is that 'length' as well as '$length' areboth valid indexes.
0 Comments:
Post a Comment
<< Home