syntax error: `(' unexpected

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers syntax error: `(' unexpected
# 1  
Old 12-13-2001
syntax error: `(' unexpected

Hi All,

I am trying to run an executable on Sun OS and it gives me following error:

syntax error: `(' unexpected

On other server this same executable is running fine. Shell on boht server is ksh.

Please help!

# 2  
Old 12-13-2001
This usually means that the executable format of the binary does not match the executable format expected by the OS. In other words, the app was compiled on a different platform than the one you are trying to run it on. What OS is running on the machine where the app works? What OS is running on the machine where the app gives this message? And last, what is the output of the file command on each machine

i.e. file executable_file_name
# 3  
Old 12-13-2001
I'm assuming this "program" is a Korn Shell
script (???). On Sun OS, normally, the default
shell is "csh". I would ask the following...

Is the shell script installed as "executable"
(i.e. rwxr-xr-x permissions)?

Does it contain as the very 1st line:
#!/bin/ksh (or whatever path to "ksh")?

What do you get when you do...
env | grep -i SHELL

How do you actually execute the script?
# 4  
Old 12-13-2001
Just a tip I found once.... if you do not know what the contents of a file are, it helps to identify it first, as using cat or more on an executable binary can cause unexpected results.

Use the command :
file &ltname_of_file_to_examine&gt

and it will tell you the type, eg. ASCII text, executable etc.
this will then let you know if it is safe to read using cat/more etc...

# 5  
Old 12-13-2001
Thanks you all for your replies, When I do "file pmconfig" on both servers, I get exact same output. Following is output

pmconfig: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped

When I do env | grep SHELL then I see that its ksh on both machines.

Please also tell me how can I change shell for the whole machine?

Both are running sun solaris OS5.8

Please help!

# 6  
Old 12-13-2001

pmconfig is the power management configuration
utility. It reads the /etc/power.conf file.
Is the error you are seeing comming from
pmconfig itself? What I'm wondering is if the
power.conf file has some syntax error in it.
# 7  
Old 12-13-2001
oh! no its not that pmconfig. Its a different excutable comes with Informatica server component.

I am sorry about the confusion.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Syntax error: `]' unexpected

I am getting this error Syntax error: `]' unexpected. Did I do something wrong with elif? Does ksh not like double brackets? if ]; then #echo hi source ~/.bashrc; elif ]; then #echo hi source ~/.kshrc; fi (5 Replies)
Discussion started by: cokedude
5 Replies

2. Shell Programming and Scripting

Syntax error `(' unexpected

I have written this in my script but while running i am getting syntax error `(' unexpected. unload to "$BACKUP_DIR/n_fac_fid-$clliname" select * from n_fac_fid where fac_accesskey in (select fac_accesskey From n_fac_ap_fid where ap_clli="$clliname"); Any help appreciated. (3 Replies)
Discussion started by: suryanmi
3 Replies

3. Shell Programming and Scripting

Syntax error: 'fi' unexpected

unzip if ] ; then echo "Success" else echo "Some failure." fi ; I tried many time to detect the unzip error, but it keep show the syntax error wherever how I change the syntac. Hope someone can help me fix the issue, thanks. Please use code tags next time for your code and... (5 Replies)
Discussion started by: duncanyy
5 Replies

4. Shell Programming and Scripting

Syntax error near unexpected token '('

I tried to execute the code but I got this error ./Array.c: line 9: syntax error near unexpected token '(' ./Array.c: line 9: ' nvals = get_data(a,MAXARRAY);' and #include<stdio.h> #define MAXARRAY 1000 main() { int a, nvals; nvals =... (7 Replies)
Discussion started by: sgradywhite
7 Replies

5. Shell Programming and Scripting

Help with ksh syntax error Unexpected Fi

Issue resolved, thanks (6 Replies)
Discussion started by: dangell82
6 Replies

6. Shell Programming and Scripting

syntax error: `$' unexpected

Hi all, Am very new to Unix and am currently Involved in Migrating some Shell Scripts from AIX 4 to Solaris 10. While using teh for loop am getting the below error: $ echo $SHELL /usr/bin/ksh $ for file in $(ls *SEBE*) syntax error: `$' unexpected while the same works without issue on... (4 Replies)
Discussion started by: paragkhanore
4 Replies

7. Shell Programming and Scripting

Syntax error near unexpected token `('

Guys , This is an output of my script errored out for "Syntax error near unexpected token `(' " Can someone tell me whats wrong with my script. Below is my original script pasted. #!/bin/bash Script Creation Date 01/21/2010 Author baraghun ... (7 Replies)
Discussion started by: raghunsi
7 Replies

8. Shell Programming and Scripting

unexpected syntax error

Hi, i am getting following syntax error ...kingly advice why is it coming ?? #!/bin/bash find . -name "common.log" if ; then echo "1" fi Himnashu@home /bin $ ./ ./ line 7: syntax error near unexpected token `fi' ./ line 7: `fi' (9 Replies)
Discussion started by: himvat
9 Replies

9. Shell Programming and Scripting

sh: syntax error: `...' unexpected???

Hello all, I want to create a script that polls every hour a directory for the existence of a file. The file I look for is a `token` dropped by an external process at the completion of a successful FTP process. I wrote this script `checkfile.ksh`: #!/usr/bin/ksh if ] then mailx... (5 Replies)
Discussion started by: alan
5 Replies

10. Shell Programming and Scripting

Syntax Error: 'else' is not expected

We have a ksh script to insert data into our data warehouse. There are multiple if/then/else statements, most are not embedded. In this example, there is an if/then statement, and an embedded if/then/else/fi statement. The problem occurs with the closing else. I receive an error message as... (6 Replies)
Discussion started by: djschmitt
6 Replies
Login or Register to Ask a Question