I am querying a database from a bash script using following query:-
Output = echo "$QUERY_STR" | mysql -h $DB_HOST -u $DB_USER -p$DB_PASS $DB_NAME
it gives me the required output which I save in a Variable
However when I echo $output I do not get proper formatted output like in command line of mysql query.
Read one of the post to use -t in the query however for large data set it does not give proper output.
To work around it, I am saving the output in a .csv file.