What is the `<<-EOSQL` code block in Bash when running SQL? What is the `<<-EOSQL` code block in Bash when running SQL? postgresql postgresql

What is the `<<-EOSQL` code block in Bash when running SQL?


EOSQL is a limit string for a Bash Here Document block. It signifies the start and end of a text block to the bash interpreter. The limit string can be any text that doesn't appear in your block.

Variable substitution will work as normal in a here document:

#!/usr/bin/env bashcat <<-EOF$MY_EXTENSIONEOF

Then running that with the variable set:

$ MY_EXTENSION=something ./test.shsomething

In Docker you will need ENV MY_EXTENSION=something in your Dockerfile or docker run -e MY_EXTENSION=something <image> on your command line for the environment to be setup.