title: Bash script errors out; there are '\r' characters in the execution trace
body: <p>I'm trying to make a litte script that syncs my project directory with a shared git repo more or less automatically. However I just don't seem to get the first line right. So in theory this should be fine:</p>
  <pre><code>#!/bin/bash
  rsync -trnv /mnt/d/project/bundle/ /mnt/d/bundle/ --exclude=&quot;.git&quot; --delete
  cd /mnt/d/bundle/
  git add .
  read -p &quot;&quot; msg
  git commit -m $msg
  git push origin master
  cd &quot;${0%/*}&quot;
  </code></pre>
  <p>The script fails, afaik, because it ignores the second option of the rsync command completely. Moreover it can't find the directory, which is an absolute path and exists. See:</p>
  <pre><code>$ bash -x ptmrbundle-rsync.sh
  + rsync -trnv /mnt/d/bundle/ /mnt/d/project/bundle/ --exclude=.git $'--delete\r' rsync: --delete\#015: unknown option rsync error: syntax or usage error (code 1) at main.c(1572) [client=3.1.1]
  + cd $'/mnt/d/bundle/\r' : No such file or directory: cd: /mnt/d/bundle/
  </code></pre>
  <p>Note: working on linux subsystem for windows.</p>
  <p>So the rows of commands work just fine in the shell itselt, but when used in the .sh script if complettely fails. What's the matter?</p>