title: Syntax error: "(" unexpected on shell script
body: <p>I'm getting <code>7: Syntax error: "(" unexpected</code> error while running bellow code on Ubuntu. But It's run on centos without any issues.</p>
  
  <pre><code>#!/bin/sh
  #
  TODATE=`date '+%Y-%b-%d'`
  #
  # Backup Creation for Databases
  #
  databases=(`echo 'show databases;' | mysql -u root -ppaSSword | grep -v ^Database$`)
  for DB in "${databases[@]}"; do
  mysqldump --force --opt --user=root --password=paSSword $DB | gzip &gt; /mnt/Backup/DB/${DB}_${TODATE}.sql.gz
  done
  #
  </code></pre>
  
  <p>Please help me to solve this.</p>
  
  <p>I can't figure out problem. But, </p>
  
  <p>I'm using bellow code for backup. It's working fine with Ubuntu</p>
  
  <pre><code>#!/bin/bash
  #
  TODATE=`date '+%Y-%b-%d'`
  databases="$(mysql -u root -ppaSSword -Bse 'show databases')"
  for DB in $databases
  do
  mysqldump -u root -psqlMYadmin $DB | gzip &gt; /mnt/Backup/DB/${DB}_${TODATE}.sql.gz
  done
  </code></pre>