title: ksh syntax error: `if' unmatched
body: <p>I'm new in ksh world and I have a problem right now with a script. The script under this lines is into the .profile file of a user in a UNIX machine and when I try to connect whith him i get always the error </p>
  
  <blockquote>
    <p>home/userTest/.profile: syntax error: `if' unmatched</p>
  </blockquote>
  
  <p>I don't know how to solve this, because I suppose that this scripts defines the prompt for the connected user, and if I have this error the prompt only shows "$"</p>
  
  <p>I tried the command</p>
  
  <blockquote>
    <p>ksh -n /home/userTest/.profile</p>
  </blockquote>
  
  <p>and I get the error always in the last line of the file</p>
  
  <pre><code>#!/bin/ksh
  # ksh example 
  if [[$0 = "ksh"]];
  then
    bash
    exit $?
  fi
  
  if [[$0 = "-ksh"]];
  then
    bash --login
    exit $?
  fi
  
  export LOGIN=$LOGNAME
  
  #prompt config
  PS1="$LOGIN@"$(hostname)":$PWD"
  
  if [["$(id -u)" = "0"]];
  then
    export PS1="$PS1# "
  else
    export PS1="$PS1&gt; "
  fi
  
  #Alias utile
  alias ll="ls -la"
  
  #Set any export here
  export PATH_EXAMPLE=/home/userTest
  export JAVA_HOME=$PATH_EXAMPLE/games/java/current
  export PATH=$JAVA_HOME/bin:$PATH
  </code></pre>
  
  <p>How can I solve this problem ?</p>
  
  <p>Thanks.</p>