title: Syntax error near unexpected token 'then'
body: <p>I typed the code the same as <a href="https://rads.stackoverflow.com/amzn/click/com/1593273894" rel="noreferrer" rel="nofollow noreferrer">The Linux Command Line: A Complete Introduction</a>, page 369
  but prompt the error:</p>
  <pre><code>line 7 `if[ -e &quot;$FILE&quot; ]; then`
  </code></pre>
  <p>the code is like:</p>
  <pre><code>#!/bin/bash
  #test file exists
  
  FILE=&quot;1&quot;
  if[ -e &quot;$FILE&quot; ]; then
    if[ -f &quot;$FILE&quot; ]; then
       echo :&quot;$FILE is a regular file&quot;
    fi
    if[ -d &quot;$FILE&quot; ]; then
       echo &quot;$FILE is a directory&quot;
    fi
  else 
     echo &quot;$FILE does not exit&quot;
     exit 1
  fi
     exit
  </code></pre>
  <p>I want to figure out what introduced the error. How can I modify the code? My system is Ubuntu.</p>