I have the following code -
ssh host sh -s << EOF
cd /backup/
ls
psql -U user -d db << SQL
$(sed 's/${previous_quarter}/${current_quarter}/' table_quarters.sql);
$(sed 's/${previous_quarter}/${current_quarter}/' plans.sql);
SQL
EOF
This is the order of execution it is following when I execute it -
table_quartersscriptplansscriptlscommand.
Why is it not following this order of execution -
lscommandtable_quartersscriptplansscript