How can I do line breaks properly in bash script? The following command works fine without adding line breaks:
for i in {table1,table2,table3}; do psql -U postgres -c "\COPY (SELECT * FROM "DB"."$i") TO "$i".csv DELIMITER ',' CSV"; done
However, I would like add to more table names in the script. I keep getting (Filename too long) error. I would like to do something like the following:
for i in {table1, \
table2, \
table3}; do psql -U postgres -c "\COPY (SELECT * FROM "DB"."$i") TO "$i".csv
DELIMITER ',' CSV"; done
But I keep getting the error:
ERROR: syntax error at or near "}"
{,}, and,s between braces.