Errors-- Any Idea


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Errors-- Any Idea
# 1  
Old 10-18-2007
Errors-- Any Idea

Getting some errors when i run this script..
./xml_load_process.txt[15]: -jar: not found
./xml_load_process.txt[23]: syntax error at line 31 : `then' unmatched

any ideas...really miffed at my inability to spot the error....

Code:
#!/bin/ksh

# set -o xtrace

# set environment variables

export DSAsourcedir=/app/ecr/powercenter/7.1.4/BAS/server/SrcFiles/ECR/DSA


SRC_EXTRACT=CRDLITE.xsl
META_ExTRACT=MetadataExtract.xsl
#SAXON=saxon.jar
PATH_TO_SAXON=/opt/java1.4/jre/bin/java -jar saxon.jar
X_EXT='.XML'
O_EXT='.OK'

X_TGT_FILE=$SRC_FILE${O_EXT}
M_TGT_FILE=$SRC_FILE${X_EXT}

SRC_FILE=`ls -la *xml`

## Main Body

if [ ${#SRC_FILE} -gt 0 ]

then

$PATH_TO_SAXON $SRC_FILE $SRC_EXTRACT > $X_TGT_FILE && $PATH_TO_SAXON $SRC_FILE $META_EXTRACT > $M_TGT_FILE

fi


Last edited by vino; 10-18-2007 at 03:06 PM.. Reason: added code tags
# 2  
Old 10-18-2007
I'm not a scripting expert at all, but it looks to me like you're trying to list a path in line 15 including a directory named "java-jar" but have an accidental space between the a and the -.

Also, do you need a ; or something after the if statement so it knows you're done specifying the condition?
# 3  
Old 10-18-2007
Can you post the code in a [ CODE ] block so we can get an idea of your formatting?
# 4  
Old 10-18-2007
Quote:
Originally Posted by jazz21
Getting some errors when i run this script..
./xml_load_process.txt[15]: -jar: not found
./xml_load_process.txt[23]: syntax error at line 31 : `then' unmatched

any ideas...really miffed at my inability to spot the error....

Code:
#!/bin/ksh

# set -o xtrace

# set environment variables

export DSAsourcedir=/app/ecr/powercenter/7.1.4/BAS/server/SrcFiles/ECR/DSA


SRC_EXTRACT=CRDLITE.xsl
META_ExTRACT=MetadataExtract.xsl
#SAXON=saxon.jar
PATH_TO_SAXON=/opt/java1.4/jre/bin/java -jar saxon.jar
X_EXT='.XML'
O_EXT='.OK'

X_TGT_FILE=$SRC_FILE${O_EXT}
M_TGT_FILE=$SRC_FILE${X_EXT}

SRC_FILE=`ls -la *xml`

## Main Body

if [ ${#SRC_FILE} -gt 0 ]

then

$PATH_TO_SAXON $SRC_FILE $SRC_EXTRACT > $X_TGT_FILE && $PATH_TO_SAXON $SRC_FILE $META_EXTRACT > $M_TGT_FILE

fi

Code:
PATH_TO_SAXON=/opt/java1.4/jre/bin/java -jar saxon.jar

becomes
Code:
PATH_TO_SAXON="/opt/java1.4/jre/bin/java -jar saxon.jar"

Code:
if [ ${#SRC_FILE} -gt 0 ]

then

$PATH_TO_SAXON $SRC_FILE $SRC_EXTRACT > $X_TGT_FILE && $PATH_TO_SAXON $SRC_FILE $META_EXTRACT > $M_TGT_FILE

fi

becomes
Code:
if [[ $? -eq 0 ]] ; then 
$PATH_TO_SAXON $SRC_FILE $SRC_EXTRACT > $X_TGT_FILE && $PATH_TO_SAXON $SRC_FILE $META_EXTRACT > $M_TGT_FILE
fi

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script Idea's / Help

Hi there, I'm pretty new to scripting and wondering if anyone had any idea's, scripts or snippets on how I can do the following. I basically want a shell script that will look at all the files in a directory and find all the names and addresses in them then output them to the screen nicely... (12 Replies)
Discussion started by: mrpugster
12 Replies

2. UNIX for Advanced & Expert Users

Need some more idea...urgent

Hi friends.. I am using the below command to search few files from many folders which is under one folder.. i mean let say the path is A/B/C...and inside C...i have 1-10 folder... the below command is working fine.... find /A/B/C -name "*.txt" -o -name "*.csv" -o -name "*.TXT" -o -name... (1 Reply)
Discussion started by: sapan123
1 Replies

3. Shell Programming and Scripting

help... no idea what to use

my issue now is i have a txt file containing a list like below i want to create a script that will add a constant text "Find this name" at the start and "at your directory" at the end. every line should be added by phrase at the start and end. Each line of the file should look like "Find... (4 Replies)
Discussion started by: dakid
4 Replies

4. UNIX for Dummies Questions & Answers

Major OS errors/Bash errors help!!!!

Hi all, dummy here.... I have major errors on entering the shell. On login I get: -bash: dircolors: command not found -bash: tr: command not found -bash: fgrep: command not found -bash: grep: command not found -bash: grep: command not found -bash: id: command not found -bash: [: =: unary... (12 Replies)
Discussion started by: wcmmlynn
12 Replies

5. Shell Programming and Scripting

b-shell: any better idea for this one?Thanks!!

I'm new to the script programming and I have this piece of code (repeatedly used) in my program: while : do ................ ans=`ckyorn -p "Do you want to continue?"` if || || || ; then break elif || ; then echo "Aborting..." exit... (2 Replies)
Discussion started by: bluemoon1
2 Replies

6. Shell Programming and Scripting

any good idea on this?

txt file like this, 1 2 3 4456 a bb c d 3 f e 1 k 32 d m f e 123 m 2 k every line contains 3 or more columns, all the columns are separated by space, and every column includes 1 to 3 character. what I wanna do is deleting the first three columns, and keep the rest no matter how long... (7 Replies)
Discussion started by: fedora
7 Replies

7. AIX

Adapter Errors and Link Errors

$ errpt | more IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION 3074FEB7 0802050205 T H fscsi1 ADAPTER ERROR B8113DD1 0802050205 T H fcs1 LINK ERROR B8113DD1 0802050205 T H fcs1 LINK ERROR 3074FEB7 0802050205 T H fscsi0 ADAPTER ERROR B8113DD1 ... (2 Replies)
Discussion started by: mcastill66
2 Replies

8. UNIX for Advanced & Expert Users

Adapter Errors and Link Errors

$ errpt | more IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION 3074FEB7 0802050205 T H fscsi1 ADAPTER ERROR B8113DD1 0802050205 T H fcs1 LINK ERROR B8113DD1 0802050205 T H fcs1 LINK ERROR 3074FEB7 0802050205 T H fscsi0 ADAPTER ERROR B8113DD1 ... (0 Replies)
Discussion started by: mcastill66
0 Replies

9. Shell Programming and Scripting

Limitations of awk? Good idea? Bad idea?

Keeping in mind that I'm relatively comfortable with programming in general but very new to unix and korn/bourne shell scripts.. I'm using awk on a CSV file, and then performing calculations and operations on specific fields within specific records. The CSV file I'm working with has about 600... (2 Replies)
Discussion started by: yongho
2 Replies
Login or Register to Ask a Question