`(' unexpected error when running a shell script in AIX

Hi,

We are moving from linux to AIX servers, and as a result testing our scripts on the new platform. When I run one of our scripts, I get the following error message:
./branchDataUpdate.sh[20]: syntax error at line 21 : `(' unexpected

Following is an extract from the script:

......
.....

#!/bin/sh
JAVAHOME=/usr/opt/WebSphere/AppServer/java/bin/java
CLASSPATH=""
CLASSPATH_JARS=(
"/usr/opt/shared/app/Test1.jar"
"/usr/opt/shared/app/Test2.jar"
"/usr/opt/shared/app/Test3.jar"
"/usr/opt/shared/app/Test4.jar")
LOG=/usr/opt/logs/branchData
...
...

The error maybe happenig where the array is defined. Ideas/thoughts?

You are correct.

On AIX sh is a link to ksh (not synonymous with BASH, as on Linux).

You can possibly:

  • Change the shebang to #!/bin/bash - if it's installed
  • Change the shebang to #!/usr/bin/ksh93
  • Change the array syntax to the ksh "set -A" format