Help with ksh syntax error Unexpected Fi


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with ksh syntax error Unexpected Fi
# 1  
Old 01-10-2013
Help with ksh syntax error Unexpected Fi

Issue resolved, thanks

Last edited by dangell82; 01-14-2013 at 10:32 AM.. Reason: Please use code tags
# 2  
Old 01-10-2013
check these lines:
Code:
 
>> $ABATCH_LOG/$JOB_LOG 2>&1
echo "$SUBMIT_CONCSUB"  >> $ABATCH_LOG/$JOB_LOG 2>&1

repeated line? missing command?
# 3  
Old 01-10-2013
No, We have other scripts with the same line that work fine. I have tried compring it to other scripts and cant find anything wrong.
# 4  
Old 01-10-2013
turn -x option in script to see execution echo and help debug. I suspect that one of the file names used in the variables for the if statments might have a space in it.

Last edited by rdrtx1; 01-10-2013 at 08:06 PM..
# 5  
Old 01-11-2013
I ran it but it's more information than I want to post on the internet. What am I looking for in this log?
# 6  
Old 01-11-2013
echo the variables used in the ifs statements right before the test, maybe some of them have spaces or are empty.
# 7  
Old 01-14-2013
I found it, turns out there was an extra
Code:
fi

in there. Thanks for the help.
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. UNIX for Beginners Questions & Answers

Syntax error near unexpected token 'do'

Hello all, Please i have this command i used to zip different files in differents directory, but i have an error. Note that when i run the command in one directory it works fine. /X5/WORK/BGH/INV/REG/pdf/SEND/BGH12523/1/*.fo /X5/WORK/BGH/INV/REG/pdf/SEND/BGH24523/1/*.fo... (3 Replies)
Discussion started by: gillesi
3 Replies

3. 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

4. Shell Programming and Scripting

ksh Script - Syntax error `done' unexpected

Hello, I am working on my first ksh script to review daily reports. The script uses different functions to check different types of reports in csv format. A control file gets read in with information regarding the report, other info, and the function to use. When I run the script I get the... (4 Replies)
Discussion started by: bot9196
4 Replies

5. Shell Programming and Scripting

Syntax error: 'fi' unexpected

unzip file.zip 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

6. Shell Programming and Scripting

Syntax error near unexpected token `}' please help

I'm going mad not being able to get this to work. im assuming its only a simple mistake but its driving me bonkers trying to find it. Please if you can help me it would save me pulling my hair out!! Thanks #!/bin/bash -xv # #Config name="TEST Server" + name='TEST Server'... (6 Replies)
Discussion started by: Fisheh
6 Replies

7. Shell Programming and Scripting

ksh syntax error: `(' unexpected

So I am trying to convert my bash script into ksh, and this is what I have in the file so far: #!/bin/ksh login() { if then sendcmd BETA else sendcmd "$(xxd -c 32 -g 0 ${ZETA_ZETA} | awk '{print $2}')" fi } But when I run it: $ ./test.sh ... (1 Reply)
Discussion started by: guitarscn
1 Replies

8. 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

9. 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 $ ./a.sh ./a.sh: line 7: syntax error near unexpected token `fi' ./a.sh: line 7: `fi' (9 Replies)
Discussion started by: himvat
9 Replies

10. 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
Login or Register to Ask a Question