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
Post a Comment