BASH: loop-reading a list creating a dynamic array -


i have list formatted below. if replace list by, say, "aaa bbb ccc", works fine. idea?

list=$(echo -e "1.1 1.2 mgmt")  n=0 in $list;    let "array1_$i[$n]=$(date "+%n")"    ((++n)) done  n=0 in $list;    var=array1_$i[$n]    echo ${!var}    ((++n)) done 

thanks in advance ideas...

you can change shebang line to

#!/bin/bash -xv 

to see bash tries run. in fact, trying create variable named array1_1.1, not valid variable name: dots not allowed.


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -