You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/11/17 17:53:55 UTC

[GitHub] [airflow] ulisesojeda commented on issue #13942: Bash Operator can't run custom bash commands

ulisesojeda commented on issue #13942:
URL: https://github.com/apache/airflow/issues/13942#issuecomment-971818394


   Hi @tandelDipak,
   
   In order to define custom commands (functions) you can define it in a single line before calling. 
   The BashOperator is not defined to execute a script before running the **bash_command**
   
   **Example:**
   
   ```
   run_this = BashOperator(
       dag=dag,
       task_id='run_bash',
       bash_command="print_my_input() { echo Your input: $1 ; } && print_my_input 222",
   )
   ```
    **Result:**
   {subprocess.py:78} INFO - Your input: 222
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org