title: Simple Shell Script does not append to file
body: <p>The following script does not work:</p>
  
  <pre><code>#!/bin/sh
  FILE="/root/.bashrc"
  if [ -f $FILE ]
   then
  
   COMMAND="alias ls='ls -la --color=always --human'"
  
   if grep -q "$COMMAND" $FILE
   then
    echo "NOT CHANGED, Already existing: $COMMAND in $FILE"
   else
    $FILE &lt;&lt; $COMMAND
    echo "CHANGED: $COMMAND in $FILE"
   fi
  
  else
    echo "$FILE does not exist, will not apply changes: $COMMAND"
  fi
  </code></pre>
  
  <p>I get this Error: 32: <code>Syntax error: end of file unexpected (expecting "fi")</code></p>
  
  <p>I would be very thankful for advice. I am a complete shell newbie, I did some tests but do not understand why this error comes.</p>
  
  <p>Thanks!!
  Jens</p>