I am trying to store each value from the following sql select statement and store them in separate variables using bash.
#!/bin/bash
mysqlhost="thehost"
mysqldb="thedb"
mysqlun="theusername"
mysqlpw="thepassword"
mysqlconnection="--disable-column-names --host=$mysqlhost --user $mysqlun --password=$mysqlpw --database=$mysqldb"
declare -a pinIDs=$(mysql $mysqlconnection -e "SELECT pinID FROM somewhere WHERE something = something";)
I get the following result when I use code
echo $pinIDs
8 11 23 26
I need to store each of those values into their own variable.