title: '\r': command not found - .bashrc / .bash_profile
body: <p>I have windows, using Cygwin, trying to set <code>JAVA_HOME</code> permanently through my <code>.bashrc</code> file. </p>
  
  <p><strong>.bashrc:</strong></p>
  
  <pre><code>export PATH="$JAVA_HOME/bin:$PATH"  
  export JAVA_HOME=$JAVA_HOME:"/cygdrive/c/Program Files (x86)/Java/jdk1.7.0_05"
  </code></pre>
  
  <p><strong>.bash_profile:</strong></p>
  
  <pre><code>if [ -f ~/.bashrc ]; then
     source ~/.bashrc
  fi
  </code></pre>
  
  <p><strong>running cygwin:</strong></p>
  
  <pre><code>-bash: $'\377\376if': command not found
  -bash: $'then\r': command not found
  : No such file or directorysu//.bashrc
  -bash: /cygdrive/c/Users/jhsu//.bash_profile: line 3: syntax error near unexpected token `fi'
  -bash: /cygdrive/c/Users/jhsu//.bash_profile: line 3: `fi'
  </code></pre>
  
  <p>I am not sure if I took the commands from a tutorial that was meant for another system or if I am missing a step.  Or whitespace is causing my commands not to run properly. </p>
  
  <p>I've looked at multiple similar questions but I haven't found one where the question has my error exactly. </p>
  
  <hr>
  
  <p>My home path:</p>
  
  <pre><code>$ echo $HOME
  /cygdrive/c/Users/jhsu
  $ echo ~
  /cygdrive/c/Users/jhsu/
  </code></pre>
  
  <p>So I believe the files should be placed in the correct spot.</p>