I have this depends file in my $PATH:
#!/bin/bash
k=0
for i in "$@"
do
DP[k]="nodejs-$i"
k=$((k+1))
done
echo $DP
I ran depends js kd and it returned:
nodejs-js
this surprised me as I thought that the result I would get would be:
nodejs-js nodejs-kd
as the loop was meant to be adding new elements to the DP array of form nodejs-$i where $i is the input I provided to the depends script when I ran it. I have tried using this depends script instead:
#!/bin/bash
DP=()
for i in "$@"
do
DP+=("nodejs-$i")
done
echo $DP
but it returned the exact same result, with the js kd inputs (i.e., the output was nodejs-js).