I have a issue.
I build a script can connect to database and select a value from table
But i can't get only the result
this is my script
while IFS='' read -r line || [[ -n "$line" ]]; do
mysql -p<pass-db> -e "select id from test where concat(upper(trim(firstname)), ' ', upper(trim(lastname)))=upper('$line')" mydatanase
echo ${IDS[j]}
let "j++"
done < employees.txt
the output of echo is
id
78
i would only get the "78" , not the name of colomun
echoonly two lines? or a series of lines: Id then number then id after then number and so on ?