title: AIX - bash script
body: <p>I'm trying to implement a small bash script in AIX, but I'm having some problems. Bellow you can find a example. I have another question, if I want to add the script to Crontab, I think I'll have problems to call serverStatus.sh from IBM, how can avoid this problem.</p>
  
  <pre><code>#!/usr/bin/sh
  
  WAS_HOME="/usr/IBM/WebSphere/AppServer/profiles/bpmnprd01/"
  
  function StatusCheck()
  {
  
  $WAS_HOME/bin/serverStatus.sh BPM.AppTarget.bpmnprd01.0 -username admin -password admin
  status=$(cat /usr/IBM/WebSphere/AppServer/profiles/bpmnprd01/logs/BPM.AppTarget.xxxxx/serverStatus.log| awk '{ if (NF &gt; 0) { last = $NF } } END { print last }' "$@")
  text="STOPPED"
  if  [[ $text == $status ]]
      then
      echo "OK"
  else
      echo "NOK"
  fi
  }
  
  function start()
  {
  StatusCheck
  }
  start
  -----------------------
  </code></pre>
  
  <p>when I try to execute the script above, I get the following error:</p>
  
  <pre><code>[root@bpmnprd01]/root/health_check# ./servers_check.sh
  ./servers_check.sh[7]: 0403-057 Syntax error at line 7 : `(' is not expected.
  </code></pre>
  
  <p>...after this I search on google, and I found some examples without "()" on subroutine.But I got this:</p>
  
  <pre><code>[root@bpmnprd01]/root/health_check# ./servers_check.sh
  ./servers_check.sh[30]: 0403-057 Syntax error at line 33 : `StatusCheck' is not expected.
  </code></pre>
  
  <p>Thanks in Advance
  Tiago</p>