title: Function failure - shell script converted from Bash to Korn
body: <p>I wrote a shell script that does data manipulation on a server running bash shell. </p>
  
  <p>My script has a function which retrieves data inside ZIP files</p>
  
  <pre><code>function getCTLfile() {
    for i in ${Array[@]}; do 
      if [[ `echo ${i}|awk -F . '{print $NF}'` == "ctl" ]]; then 
        echo "${i}" 
      fi
    done
  }
  </code></pre>
  
  <p>It works great but this machine hardware is faulty so our sysadmin requested that I port my code to another server running Korn shell.</p>
  
  <p>When I run my script, it fails on my function!! Even if I type it from the command line. </p>
  
  <pre><code>$ function getCTLfile() {
  -ksh: syntax error: `(' unexpected
  </code></pre>
  
  <p>Do I need to change my syntax anywhere? I did some research and it seems that everything should work.</p>