The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

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 09:49 AM
Getting error "syntax error at line 78 : `<' unmatched" sshah1001 Shell Programming and Scripting 1 05-08-2008 06:41 PM
list of unmatched columns mohan705 Shell Programming and Scripting 3 12-12-2007 10:37 AM
Delete unmatched data nazri76 Shell Programming and Scripting 5 07-16-2006 07:41 AM
Unmatched 'then' akpopa UNIX for Dummies Questions & Answers 22 09-05-2001 10:29 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-09-2007
b.hamilton b.hamilton is offline
Registered User
  
 

Join Date: Oct 2007
Location: Manchester, UK
Posts: 5
else unmatched

I'm getting an else unmatched error on the script below..

For info : SYDB is the database name entered as a param on the command line.

#Check the DB name
HBDB=`sql $SYDB <<_END_ | grep '^|' | grep -v dbase | sed 's/|//g' | sed 's/ //g'
set autocommit on;
\p\g
set lockmode session where readlock = nolock;
\p\g
select squeeze(trim(dbase)) as dbase
from syapplic
where applic_id = 'hb';
\p\g
_END_`

if [ -z "$HBDB" ]
then
echo "The HB Database name given is not a valid database!"
exit 1
else
echo "The Hb database name is $HBDB "
echo " "
fi

# Declare variables for output
MAINFOLDER=/*server location*/sig10
FILEDATE=`date +%Y%m%d`
FILETIME=`date +%H:%M:%S`
OUTPUTFILE="$MAINFOLDER/Sig_Birthdays_10_$FILEDATE.csv"

#check that the comparison tale exists withing the HBDB
TBL_CHECK=`sql $HBDB <<_END_ | grep '^|' | grep -v table_name | sed 's/|//g' | sed 's/ //g'
set autocommit on;
\p\g
set lockmode session where readlock = nolock;
\p\g
select table_name
from iitables
where table_name = 'bh_sig_10';
\p\g
_END_`

echo $TBL_CHECK

if [ "$TBL_CHECK" = "bh_sig_10" ]
then
echo "Comparison table exists"
else
echo "Comparison table does not exist - Script will create table"
sql $HBDB <<_END_ > $MAINFOLDER/Create_comparison_table.txt
set autocommit on;
\p\g
set lockmode session where readlock = nolock;
\p\g
create table bh_sig_10 (
claim_id i4,
title varchar 4,
forename varchar 32,
surname varchar 32,
birth_date date
)
with nojournaling,
noduplicates;
\p\g
_END_
fi
...

I get the else unmatched on that else in bold....any clues?
 

Bookmarks

Tags
awk, awk trim, trim, trim awk

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:18 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0