Question on error from script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Question on error from script
# 1  
Old 12-05-2008
Question on error from script

I used set -n FS.sh to check for syntax errors. No problems. I run the script with set -x and set -v with the following error:
find: bad option ;
find: path-list predicate-list

Reviewing the verbose output everything is read correctly. The files transfer and the script completes. I can't seem to narrow the problem down. Any suggestion would be greatly appreciated as to what might be wrong.


Code:
 
find $u06_path -name "e*${u06_dmp_file}.dmp.gz" | while read file            #while loop to parse list
        do
                      scp -rp  $file $RemoteServer
                      if [[ $?  -ne 0 ]]
                       then
                              echo "" >> $LOG_path/FS_`date +%Y%m%d`.log
                              echo "SCP exit status is" "$?" >> $LOG_path/FS_`date  +%Y%m%d`.log
                              echo "SCP Failed" >> $LOG_path/FS_`date +%Y%m%d`.log
                              echo "" >> $LOG_path/FS_`date +%Y%m%d`.log
                       else
                              rm $file
                              echo "SCP exit status is" "$?" >> $LOG_path/FS_`date  +%Y%m%d`.log
                              echo "SCP Passed for " $file >> $LOG_path/FS_`date  +%Y%m%d`.log
                       fi
                done

# 2  
Old 12-05-2008
Please show the line with the find command without using "set -x" or at least while variables being not substituted.
# 3  
Old 12-05-2008
Code:
  #if fs > threshold find files to move to different  filesystem
 if [[ $UsedSpace_u06 -gt $Threshold_u06 ]]
 then
  
         find $LOG_path -name "FS_*.log" -mtime +4 -exec rm  '{}' +
         echo "" >> $LOG_path/FS_`date  +%Y%m%d`.log
         echo "Files to be copied to XXXX..." >>  $LOG_path/FS_`date +%Y%m%d`.log
         find $u06_path -name "e*${u06_dmp_file}.dmp.gz"  >> $LOG_path/FS_`date +%Y%m%d`.log \;
         find $u06_path -name "${u06_dmp_file}" >>  $LOG_path/FS_`date +%Y%m%d`.log \;
         find $u06_path -name "e*${u06_dmp_file}.dmp.gz" |  while read file              #while loop to parse list
         

                 do
                         scp -rp $file  $RemoteServer
                         if [[ $? -ne 0 ]]
                         then
                                 echo "" >>  $LOG_path/FS_`date +%Y%m%d`.log
                                 echo "SCP exit status is"  "$?" >> $LOG_path/FS_`date +%Y%m%d`.log
                                 echo "SCP Failed" >>  $LOG_path/FS_`date +%Y%m%d`.log
                                 echo "" >>  $LOG_path/FS_`date +%Y%m%d`.log
                         else
                                 rm $file
                                 echo "SCP exit status is"  "$?" >> $LOG_path/FS_`date +%Y%m%d`.log
                                 echo "SCP Passed for " $file  >> $LOG_path/FS_`date +%Y%m%d`.log
                         fi
                 done
 fi
 find: bad option ;
 find: path-list predicate-list
 find: bad option ;
 find: path-list predicate-list

# 4  
Old 12-05-2008
What's the variable? $LOG or $LOG_path?
Best write your variables like this to protect them when adjacent to other characters:
Code:
${LOG} 
# or
${LOG_path}   # if _path is part of the variable name

In your 1st post there was maybe only a partial substitution of your variable:
Quote:
find $u06_path .......
# 5  
Old 12-05-2008
Good point about isolating the variables. When the script was set to -x I verified variable substitution. I'll go back make corrects to variables with curly braces and run it again.

The thing that gets me is why would the script process the files when an error like this occurs. When I miss a double quote around -name option find command explodes with similar error. So I thought I was missing syntax.

Thanks for the suggestions.

Regards
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Question about Error Report script

Hi i need to understand what "errpt -s 0328000014" will do in script. will this only capture data for 28th march at 00:00 hrs. if issue happen it is ok else nothing or for 28th march and onwords it will run and and check every day at 00:00 hrs for issue to occur below is the snippet... (1 Reply)
Discussion started by: scriptor
1 Replies

2. Shell Programming and Scripting

Question about syntax error

first of all.. sorry about all the question bombing.. im bored atm so im currently playing around with sh scripting hehe s = `expr ls -s Documents | grep Music | awk '{ print $1 }' ` t = `expr $t + $s` it give syntax error s not found t not found lol... any idea why? (7 Replies)
Discussion started by: Nick1097
7 Replies

3. Shell Programming and Scripting

Error redirection question

Hi gurus, I have a question, need some of your inputs... I have a command like this : export LINE_COUNT=`wc -l test.dat | awk '{print $1}'` echo $LINE_COUNT --- > gives me 2 which is fine as the file has 2 lines. This works fine if the file test.dat is present but in case... (3 Replies)
Discussion started by: calredd
3 Replies

4. Programming

Newbie Question.. -> error: syntax error before ';' token

Hello, the following is generating a error at the line "tmprintf(&tmBundle, _TMC("{0}"),Prompt);"... a bit lost as I am diving into this debug... Thank you in advance... int H_YesNo(TMCHAR *Prompt, int DefVal) { TMCHAR YesNo = '\0'; tmprintf(&tmBundle, _TMC("{0}"),Prompt); while... (3 Replies)
Discussion started by: reelflytime
3 Replies

5. Filesystems, Disks and Memory

Question - error during boot

I have an HP NetServer LH3 which is exhibiting an error during the boot process. I am getting the following messages, none of which I've seen before 1. WARNING: SCSI adapter: Cannot install intr vecno=12 type=4 IPL=5 Vector 12 is private 2. WARNING: "TEST_UNIT_READY" Command timed 11 seconds... (0 Replies)
Discussion started by: slant-40
0 Replies

6. Programming

C Question compilation error

What does the following mean: state_field state_abvr = { "AL","ALABAMA", "AK","ALASKA", . . . }; extern state_field state_abvr; issues we I am facing following compilation issue bosdf9d1:root make CC -I/bto/bcs/shared/include -I/bto/sys/BCS/usr/include ... (1 Reply)
Discussion started by: jaganreddy
1 Replies

7. Shell Programming and Scripting

Newb scripting question, I get the error script not found

This is probably a really simple problem, but goes easy on me I'm still a newb. The problem I have is that a script (we'll call it script.script) I edited won't run for some reason, I get the error "ksh: script.script: not found" The location of my script is as follows: /home/users/arkitech ... (3 Replies)
Discussion started by: Arkitech
3 Replies

8. Shell Programming and Scripting

Question about error reporting

hi all, i've got a script that takes in what a user enters (multiple entries) and then joins them all together and appends this to a file. what i want to happen now is the terminal should display "record saved" if the save to the file is successful, if it isn't just display the standard unix... (2 Replies)
Discussion started by: wazzag
2 Replies

9. UNIX for Advanced & Expert Users

Question about error

While attempting to use ftp to retrieve a file from a remote server (running SCO Unix 5.0.2), it eventually returns a timeout error with the following message - netin: connection reset by peer. I can't find any reference to this error. Has anyone encountered it before, or know what causes it? (3 Replies)
Discussion started by: Howeird
3 Replies

10. UNIX for Dummies Questions & Answers

Error Question

Every night I recieve this message: Verify Report - Broken/missing symbolic links File With Discrepancies : 213 Total Discrepancies : 213 Can anyone explain what this is and how I can resolve it? Thanks, DJ At Work (4 Replies)
Discussion started by: djatwork
4 Replies
Login or Register to Ask a Question