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


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting `(' unexpected error when running a shell script in AIX
# 1  
Old 03-31-2010
`(' 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:

......
.....
Code:
#!/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?

Last edited by Scott; 03-31-2010 at 09:40 PM.. Reason: Code tags, please...
# 2  
Old 03-31-2010
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
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Error while running Procedure in shell script

Hi All, I am running the below proc in unix by connecting through sqlplus and the procedure is completing successfully. But when i am trying to run through shell scripting by using function. I am getting the error as follows. Please guide me where I am going wrong. #!/bin/sh opera () {... (6 Replies)
Discussion started by: bhas85
6 Replies

2. Shell Programming and Scripting

SHELL: syntax error near unexpected token `else'

Hi, I wrote this shell script to be a tool for my team to do daily routine works. Though, option a and b are working fine, option c is giving below error. line 647: syntax error near unexpected token `else' line 647: `else' Here s my script. A bit lengthy though. Pls excuse. Also,... (3 Replies)
Discussion started by: Naga06
3 Replies

3. Shell Programming and Scripting

How to put a trace on shell script running in AIX?

Please help me in putting a trace on shell script running in AIX Best regards, Vishal (3 Replies)
Discussion started by: Vishal_dba
3 Replies

4. Solaris

Error during running sqlplus command from shell script in Solaris

I am using following code to connect to oracle database from solaris shell script. which will try thrice to connect the database ...at the 4rth atempt it will exir=t. count=0 while ; do sqlplus -s $usrname/$password@dbSID <<-EOF | tee $logfile WHENEVER OSERROR EXIT 9; WHENEVER SQLERROR... (4 Replies)
Discussion started by: millan
4 Replies

5. Shell Programming and Scripting

Launcher Error: while running shell script

Hi Experts, I have a shell script which used to take oracle database backup, which is scheduled in a tidal scheduling tool. however it is throwing an error while triggering the job and getting below error in the log file. "Launcher Error: This is an internal function" shell script is... (1 Reply)
Discussion started by: UnniVKN
1 Replies

6. Shell Programming and Scripting

error running shell script

how can i fix this error. + f_Delete resync-printers.ksh: test: argument expected lpadmin: Expected printer or class after '-x' option! resync-printers.ksh: test: argument expected + f_Create resync-printers.ksh: trying to execute a function (20 Replies)
Discussion started by: ggoliath
20 Replies

7. Shell Programming and Scripting

Error while running as shell script

Storage_Unit=`du -h /var/spool/cron/root|awk '{print $1}'|sed -e "s/^.*\(.\)$/\1/"` If then Size=`du -h /var/spool/cron/root|awk '{print $1}'|sed 's/.\{1\}$//'` for Size_rounded_number in $(printf %.0f $Size); do ROUNDED_Size=$Size_rounded_number done if #setting a threshold of say... (1 Reply)
Discussion started by: proactiveaditya
1 Replies

8. Shell Programming and Scripting

Help on shell script : syntax error at line 62: `end of file' unexpected

Hi All, I have written a korn script (code pasted below). It is giving the error while debugging "new.sh: syntax error at line 62: `end of file' unexpected". I have re-written the whole code in VI and explored all help related to this error on this Unix forum and tried it. Somehow, I could... (7 Replies)
Discussion started by: schandrakar1
7 Replies

9. Shell Programming and Scripting

error in running shell script in cron

#!/bin/bash CLASSPATH=. #CLASSPATH=${CLASSPATH}:${INSTALL_PATH}home/squidlog/CopyFile.java CLASSPATH=${CLASSPATH}:${INSTALL_PATH}usr/java/latest/lib/*.jar javac CopyFile.java echo "CLASSPATH=$CLASSPATH" #home/wbiadmin/JRE1.4.2/j2re1.4.2_15/bin/java CopyFile /usr/bin/java... (3 Replies)
Discussion started by: sari
3 Replies

10. UNIX for Dummies Questions & Answers

awk Shell Script error : "Syntax Error : `Split' unexpected

hi there i write one awk script file in shell programing the code is related to dd/mm/yy to month, day year format but i get an error please can anybody help me out in this problem ?????? i give my code here including error awk ` # date-month -- convert mm/dd/yy to month day,... (2 Replies)
Discussion started by: Herry
2 Replies
Login or Register to Ask a Question