title: Running python script with a parameter using cronjob gives error: /bin/sh: password: command not found
body: <p>I'm going to run a python script with a parameter using cronjob.
  The parameter is password of database that needs to be used in the script.</p>
  
  <pre><code>#!/usr/bin/python
  
  import MySQLdb
  import requests
  import json
  import os
  import sys
  param=sys.argv
  password=param[1]
  
  db = MySQLdb.connect(host="host.com",port=3306,user="user",passwd=password,db="db")
  </code></pre>
  
  <p>/etc/crontab:</p>
  
  <pre><code>SHELL=/bin/bash
  PATH=/sbin:/bin:/usr/sbin:/usr/bin
  MAILTO=root
  HOME=/
  
  # *  *  *  *  * user-name command to be executed
  </code></pre>
  
  <p>Crontab -e</p>
  
  <pre><code>*/5 * * * *  /home/test/run.py "dbpass'"
  </code></pre>
  
  <p>which python:</p>
  
  <pre><code>/usr/bin/python
  </code></pre>
  
  <p>Error in /var/spool/mail </p>
  
  <pre><code>/bin/sh: dbpass': command not found
  </code></pre>
  
  <p>If I run the script manually, it works fine:  python run.py "dbpass'"</p>
  
  <p>Any help would be appreciated.</p>