But if the program is failing at reporting code which is called from the script
What is this 'program' you are calling from the script?(i.e. sqlplus, another script, etc.)
Where does the 'program' being called log any errors/exceptions that occurs?
Check the exit status code from the 'program' in the script right after you call it:
Hello all,
I'm hoping to get a little insight from some of the wily veterans amongst you.
I've written a script to check for new outgoing files to our vendors located on our ssl server. It seems to be working ok, but the final question here, will be one of logic, and/or a better way to... (4 Replies)
My Ultra 5 (Solaris 10) is now unbootable, with the OBP failing with error "trap 3e" When it tries to boot from disk.
Disk is a Maxtor 80GB IDE, and was working previously.
I've booted to cdrom and run "Format" from Single user, but when I try to read the disk, it just core dumps.
I have... (2 Replies)
Hi folks,
I have tried to add some trap detection in the below script....this script is used to monitor database activities...in a rather awkward way :rolleyes:....
The idea behind adding trap is that....this script creates lots of temporary files in the running folder to store the count... (1 Reply)
Hey all UNIX nerds- I've built a shell script which runs pretty well- only I want it to have much better error trapping. (Like the kind I could apply to every shell script I write).
I'm not a UNIX genius, and could really use a bit of help.
The original script goes something like this:
1... (3 Replies)
I am running a script that runs a loop and executes a command on ${i} until the end of the for loop.
From time to time the command generates an error ( which is good) for example ERROR0005:
How can I trap the error and send an email echoing the ${i} variable in the loop and the error ?
... (2 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
That is the last reply I received from my instructor, and I'm looking for some alternatives.
When using... (2 Replies)
sqlplus -s usrname/password@dbSID <<-SQL >> logfile
@create_table.sql
commit;
quit;
SQL
I am running this script to execute an sql file.
I want to display the oracle error if anything found during execution of the sql file and exit from script.
Please suggest How do it. (1 Reply)
Hi,
I was working on implementing error handling in my bash scripts, and decided to use trap to send myself an email incase of any errors. But it seems that somethings has gone wrong, and I am continuously getting same emails for an old error repeatedly (even though I have stopped/killed all... (1 Reply)
Hello.
In bash, is there a way to trap error "file not found" when a script call another script which is not found; then abort.
Example ( part of script running with -x option set) :
+ return 0
+ RETURN_CODE=0
+ ]
+ /root/bin/200_yast_install/00_reset_yast_install
bash:... (5 Replies)
Hello,
We have a T5140 server with Solaris 10 and its suddenly throwing "segmentation core" when I login into the server and not showing any output for commands like df, mount etc. so I had to reboot the server to fix this issue. Please note that there's no boot disk mirroring.
But... (2 Replies)
Discussion started by: prvnrk
2 Replies
LEARN ABOUT REDHAT
catch
catch(n) Tcl Built-In Commands catch(n)
__________________________________________________________________________________________________________________________________________________NAME
catch - Evaluate script and trap exceptional returns
SYNOPSIS
catch script ?varName?
_________________________________________________________________DESCRIPTION
The catch command may be used to prevent errors from aborting command interpretation. Catch calls the Tcl interpreter recursively to exe-
cute script, and always returns without raising an error, regardless of any errors that might occur while executing script.
If script raises an error, catch will return a non-zero integer value corresponding to one of the exceptional return codes (see tcl.h for
the definitions of code values). If the varName argument is given, then the variable it names is set to the error message from interpret-
ing script.
If script does not raise an error, catch will return 0 (TCL_OK) and set the variable to the value returned from script.
Note that catch catches all exceptions, including those generated by break and continue as well as errors. The only errors that are not
caught are syntax errors found when the script is compiled. This is because the catch command only catches errors during runtime. When
the catch statement is compiled, the script is compiled as well and any syntax errors will generate a Tcl error.
EXAMPLES
The catch command may be used in an if to branch based on the success of a script.
if { [catch {open $someFile w} fid] } {
puts stderr "Could not open $someFile for writing
$fid"
exit 1
}
The catch command will not catch compiled syntax errors. The first time proc foo is called, the body will be compiled and a Tcl error will
be generated.
proc foo {} {
catch {expr {1 +- }}
}
KEYWORDS
catch, error
Tcl 8.0 catch(n)