Hey, I’m having trouble with the following code:
TABLE_RESULT=$($PSQL "SELECT * FROM table" )
echo "$TABLE_RESULT" | while read COLUMN1 BAR COLUMN2 BAR COLUMN3
do
echo "$COLUMN1" # Prints column1_value|column2_value|column3_value
done
I can’t figure out why sometimes the read in the while will identify the different column values and save them into the different variables made to capture them, while other times the whole thing will be saved as a string in the first variable
My desired output would be the values in the columns each saved into its corresponding variable.