The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
"<< Unmatched" in ksh script using sftp michaelak28 Shell Programming and Scripting 6 08-28-2008 05:49 AM
Getting error "syntax error at line 78 : `<' unmatched" sshah1001 Shell Programming and Scripting 1 05-08-2008 02:41 PM
list of unmatched columns mohan705 Shell Programming and Scripting 3 12-12-2007 06:37 AM
else unmatched b.hamilton Shell Programming and Scripting 7 10-10-2007 02:03 AM
Delete unmatched data nazri76 Shell Programming and Scripting 5 07-16-2006 03:41 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #8 (permalink)  
Old 09-04-2001
Registered User
 

Join Date: Aug 2001
Location: Ontario, Canada
Posts: 20
Stumble this Post!
Try this,

if [ conditions ] <b>;</b>
then
commands......
fi
Forum Sponsor
  #9 (permalink)  
Old 09-04-2001
Registered User
 

Join Date: Aug 2001
Location: South Carolina
Posts: 18
Stumble this Post!
Thanks, but I am still getting the same error. I have tried the semicolon's just about every which way I can.

Amber Taylor
  #10 (permalink)  
Old 09-04-2001
patvdv's Avatar
Registered User
 

Join Date: Jul 2001
Location: Belgium
Posts: 83
Stumble this Post!
Semi's

Amber,

Get of rid of all your semicolons - except the ones in the 'here' statement and put all your commands on a separate line. There's no man page for 'if' as it is not an external command but rather a shell built-in.
__________________
Patrick Van der Veken - UNIX consultant (c) 2001 - 2001 http://www.baanboard.com - http://www.ux-core.com
'True strength lies in gentleness' - Irish proverb
  #11 (permalink)  
Old 09-04-2001
rwb1959's Avatar
Registered User
 

Join Date: Aug 2001
Location: Virginia, USA
Posts: 438
Stumble this Post!
A couple of things...

First, remove the ";" after the "fi"
also, if $all_recs is from the command line,
I assume you are assigning it...

export all_recs=$1


Second, try changing:
sqlplus -s $connect_string > /dev/null << EOF

to:
sqlplus -s $connect_string << EOF > /dev/null

...the second part should not have anything
to do with the "unmatched then" but it may cause
you execution problems. Additionally, the "if"
command is a shell built-in and would be
documented in the KSH(1) man page (assuming you
are using ksh (just man the shell you use).
  #12 (permalink)  
Old 09-04-2001
Registered User
 

Join Date: Aug 2001
Location: South Carolina
Posts: 18
Stumble this Post!
Thank you all for taking the time to help me with this.

I am using ksh.

Everthing inside the if statement worked before I tried to enclose it in the if statement.

I did assign the variable and tested it with an echo.

Also, I have tested it a few times without the ';' after the fi and still it wont work.

The line listed in the syntax error corresponds to the 'then' line number in the snippets above.

The only ;'s remaining (besides the one at the end of the if line) are the ones inside the sqlplus routine.
  #13 (permalink)  
Old 09-04-2001
patvdv's Avatar
Registered User
 

Join Date: Jul 2001
Location: Belgium
Posts: 83
Stumble this Post!
Double quotes

Then there must be double quotes missing for your here doc:

Try:

<< "EOF

and

EOF"

I am not 100% sure about the exact placement of the first double quote though...
__________________
Patrick Van der Veken - UNIX consultant (c) 2001 - 2001 http://www.baanboard.com - http://www.ux-core.com
'True strength lies in gentleness' - Irish proverb
  #14 (permalink)  
Old 09-04-2001
Registered User
 

Join Date: Aug 2001
Location: South Carolina
Posts: 18
Stumble this Post!
What do you mean by "here doc"?

Thanks,

Amber Taylor
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:35 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0