0
I’m making a shellscript and have the return command:
$ sqlite3 banco.db 'select code from channels'
00 01 02 03
When I assign the return to a variable, everything becomes a single string.
$ export LISTA=$(sqlite3 banco.db 'select code from channels')
$ echo $LISTA
00 01 02 03
I would like each number to be the element of an array, as I can transform so that I can access as something like:
$ echo $LISTA[0]
00
$ echo $LISTA[1]
01
tries this way values=($(sqlite3 bank.db "select code from Channels")) cnt=${#values[@]} echo "number of variables in the array: $cnt"
– Jasar Orion