title: Passing a command line argument to airflow BashOperator
body: <p>Is there a way to pass a command line argument to Airflow BashOperator.  Currently, I have a python script that accepts a date argument and performs some specific activities like cleaning up specific folders older than given date.</p>
  
  <p>In simplified code with just one task, what I would like to do is </p>
  
  <pre><code>from __future__ import print_function
  from airflow.operators import BashOperator
  from airflow.models import DAG
  from datetime import datetime, timedelta
  
  default_args = {
      'owner'             : 'airflow'
      ,'depends_on_past'  : False
      ,'start_date'       : datetime(2017, 01, 18)
      ,'email'            : ['abc@xyz.com']
      ,'retries'          : 1
      ,'retry_delay'      : timedelta(minutes=5)
  }
  
  dag = DAG(
      dag_id='data_dir_cleanup'
      ,default_args=default_args
      ,schedule_interval='0 13 * * *'
      ,dagrun_timeout=timedelta(minutes=10)
      )
  
  cleanup_task = BashOperator(
          task_id='task_1_data_file_cleanup'
          ,bash_command='python cleanup.py --date $DATE 2&gt;&amp;1 &gt;&gt;  /tmp/airflow/data_dir_cleanup.log'
          #--------------------------------------^^^^^^-- (DATE variable which would have been given on command line)
          #,env=env
          ,dag=dag
      )
  </code></pre>
  
  <p>Thanks in advance,</p>