Saludos,
- Como todo lenguaje, cada uno tiene mejores prestaciones para hacer una u otra cosa. Bash es bastante poderoso, aunque en Listas y SubListas me parece que resalta un poco más Python.
- Teniendo en cuenta esto y entendiendo Listas y SubListas de Bash como las que tiene Python:
http://elclubdelautodidacta.es/wp/2011/09/python-capitulo-18-creacion-de-sublistas/, en Bash serías algo así el manejo de SubListas:
EdSon@EdePC ~
$ ARRAY=( zero one two three four five)
EdSon@EdePC ~
$ echo ${ARRAY[0]}
zero
EdSon@EdePC ~
$ echo ${ARRAY[4]}
four
EdSon@EdePC ~
$ echo ${ARRAY[*]}
zero one two three four five
EdSon@EdePC ~
$ echo ${ARRAY[*]:2}
two three four five
EdSon@EdePC ~
$ echo ${ARRAY[*]:2:1}
two
- Para crear una Lista (Array) cuyo nombre sea el valor de una variable:
EdSon@EdePC ~
$ NOMBRE="arrayName"
EdSon@EdePC ~
$ echo $NOMBRE
arrayName
EdSon@EdePC ~
$ eval $NOMBRE=\(1 2 3 4\)
EdSon@EdePC ~
$ echo ${arrayName[*]}
1 2 3 4
EdSon@EdePC ~
$ echo ${arrayName[2]}
3
- Referencias:
-- Array en Bash (Advanced Bash-Scripting Guide)
http://tldp.org/LDP/abs/html/arrays.html