Sponsored Content
Top Forums Shell Programming and Scripting My error is not being caught or handled Post 302355745 by ramangill on Wednesday 23rd of September 2009 03:19:26 PM
Old 09-23-2009
My error is not being caught or handled

Hi,

I my ksh script I have the following:

Code:
##--Checking the spool file for errors
NumberOfErrors=`cat $CurrSpoolFile | grep " ORA-[0-9]" | wc -l`

my logfile shows this:

Code:
PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

BEGIN sys.dbms_stats.export_schema_stats('INFOMAT','STATTAB','RIX230909'); END;

*
ERROR at line 1:
ORA-20000: Table "INFOMAT"."STATTAB" does not exist or insufficient privileges
ORA-06512: at "SYS.DBMS_STATS", line 5158
ORA-06512: at "SYS.DBMS_STATS", line 5185
ORA-06512: at "SYS.DBMS_STATS", line 5587
ORA-06512: at line 1

$NumberOfErrors should give me a result of 5 however when I run the following:

Code:
# Populating the ScriptStatus variable
ScriptStatus="There were ${IndexesBefore} Indexes before the script and ${IndexesAfter} Indexes after the script -- SQL has 
generated ${NumberOfErrors} ORA errors"

  if [[ ${NumberOfErrors} -gt 0 ]] || [[ ${IndexesBefore} -ne ${IndexesAfter}  ]]
  then
        echo "Script Errors... "                                    >> $CurrLogFile
...
...

I get a value of 0. Can anyone see why? When I run the grep command straight from the command line I get my expected results as such:
Code:
>cat Rebuild_ix_COMP.log.curr | grep "ORA-[0-9]" | wc -l
      10

I can't see anything that stands out here...I am so confused...PLEASE HELP!

---------- Post updated at 03:19 PM ---------- Previous update was at 03:14 PM ----------

I also tried this as well:

Code:
NumberOfErrors=cat Rebuild_ix_COMP.log | grep " ORA-[0-9]" | wc -l
ksh: Rebuild_ix_COMP.log: cannot execute
       0

 

8 More Discussions You Might Find Interesting

1. Linux

Maximum number of threads handled by a process????

Hi Anybody knows max. no. of threads handled by a process in linux. Please reply Thanks in advnce :confused: (0 Replies)
Discussion started by: Agnello
0 Replies

2. Programming

Ineteractive application handled using Expect script

Hi expert guys, I have unix server where i have a application for some special commands. Below way to entering in that application- bash-2.05$ telnet 11.13.58.39 2310 Trying 0.0.0.0... Connected to .. Escape character is '^]'. CONNECTING TO... PROCESS 2310 CONNECTED... Enter... (0 Replies)
Discussion started by: thepurple
0 Replies

3. AIX

process caught signal 5

Hello, We are using AIX 5.2 ML 7. One of the process in its log file said the following and stopped running. Caught signal=5, exiting. What would cause the signal 5 to be generated on an AIX box. Please advise. Thx Jerardfjay (2 Replies)
Discussion started by: jerardfjay
2 Replies

4. Shell Programming and Scripting

Move files one at the time and wait until the previous file is handled

I'm a novice at unix and need it more and more to do my work. I seem running into problems getting this script "attempt" to work: I need to copy all files in a directory, which is containing 22000 files, into a directory one level up. There a tool monitors the content of the dir and processes... (2 Replies)
Discussion started by: compasscard
2 Replies

5. Shell Programming and Scripting

Number of fields handled by awk

Hi Gurus, Have a file seperated by "~" and no of fields is 104. When i try to run awk, it erros out. awk: record `B~A31~T24_STF~~~2009...' has too many fields Any idea how can i extract a specific filed with this many fields in a row. Kindly help (3 Replies)
Discussion started by: srivat79
3 Replies

6. Shell Programming and Scripting

Line numbers and exception to be caught in logs

Hi Folks, I have just basic queries is that suppose I have to monitor the logs then there is a command , suppose I have to monitor the abc.log which is updating dynamically within seconds so the command will be after going to that directory is .. tail -f abc.log Now please advise what about... (1 Reply)
Discussion started by: punpun66
1 Replies

7. Solaris

Exiting (caught signal 11)

I created a new Virtual machine and was trying to install Solaris but keep getting this error.:confused: EXITING (caught signal 11) Type "install-solaris to restart" Can't find anything on Google. This is the iso image I am using "sol-10-u11-ga-x86-dvd" Followed all the instructions on... (5 Replies)
Discussion started by: newborndba
5 Replies

8. Shell Programming and Scripting

Continue Processing after a signal is caught

Is it possible to continue after signal is caught and control goes to function specified in the trap statement? (3 Replies)
Discussion started by: Soham
3 Replies
ppmtosixel(1)						      General Commands Manual						     ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 03:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy