title: $'\r' - command not found in bash
body: <p>I have the below script:</p>
  
  <pre><code>#!/bin/sh
  
  #parameters definition
  ROOT_PATH=/var/www/
  msql_psw="cc"
  mysql_login="bb"
  mysql_db_name="aa"
  
  echo START MYSQL DUMP
  
  NOW=$(date +"%Y-%m-%d")
  SQLFILE="log-$NOW.sql"
  mysqldump --add-drop-table -u "$mysql_login" --password="$mysql_psw" "$mysql_db_name" &gt; "$ROOT_PATH/$SQLFILE"
  </code></pre>
  
  <p>When it's run with <code>sh -x</code>, it gives command not found errors for empty lines, and even non-empty lines don't work correctly:</p>
  
  <pre><code>sh -x export_db.sh 
  + $'\r'
  : command not found2: 
  + ROOT_PATH=$'/var/www/\r'
  + msql_psw=$'cc\r'
  + mysql_login=$'bb\r'
  + mysql_db_name=$'aa\r'
  + $'\r'
  : command not found8: 
  + echo START MYSQL $'DUMP\r'
  START MYSQL DUMP
  + $'\r'
  : command not found10: 
  ++ date +%Y-%m-%d
  + NOW=$'2014-10-02\r'
  + SQLFILE=$'log-2014-10-02\r.sql\r'
  + mysqldump --add-drop-table -u $'bb\r' --password= $'aa\r'
  : No such file or directory/www/
  </code></pre>