[Backport] BashOperator: Execute templated bash script as file
Backport of #42783 to Airflow 2.
When the BashOperator fails to write the rendered Jinja into a new file, it warns the user to add "write" and "execute" permissions in the working directory before Airflow 3; and fallback to the 2.10.2 behavior: executing the content of the bash script as inline command.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.