01-13-2014
Errors are more important than output, catch them and use it appropriately.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I have a shell script that runs every minute to process incoming files delivered externally via SFTP to a directory. Basically the script works and processes the files however I get an error when a new file is delivered into the directory.
Please see my script below. A new file is... (2 Replies)
Discussion started by: richo king
2 Replies
2. UNIX for Advanced & Expert Users
Hi, new to this forum and not sure if this is the right place to post. I'm new to cron jobs and scripts, and I need some help with a script to be used with a cron job. I already have a bot set up at a certain website address and need a script that the cron job will load every day that tells it to... (1 Reply)
Discussion started by: klawless
1 Replies
3. Shell Programming and Scripting
Good morning. I am searching for "how-to"'s for some particular questions:
1. How to write a script in HP-UX 11.
2. How to schedule a script.
3. How to "call" scripts from the original script.
4. How to su to another user from within a script.
This is the basics of what the... (15 Replies)
Discussion started by: instant000
15 Replies
4. Shell Programming and Scripting
how to run a script using cron job and send the output as attachment via e-mail using unix. please help me.
how my cron job entry should be?
As of now my cron job entry is to run the script at specific time,
15 03 * * * /path/sample.sh | mail -s "Logs" email_id
In the above entry, what... (8 Replies)
Discussion started by: vidhyaS
8 Replies
5. Shell Programming and Scripting
Hi All,
I have around 900 Select Sql's which I would like to run in an awk script and print the output of those sql's in an txt file.
Can you anyone pls let me know how do I do it and execute the awk script? Thanks. (4 Replies)
Discussion started by: adept
4 Replies
6. Shell Programming and Scripting
Hello,
This may be a simple one, but i can't see what the issue is.
When i run the script via CLI, then i get the correct output via the if statement, but when i run via CRON i get the wrong statement.
echo " Checking Job Status" >> $DIR/Bpimagecleanup_$DATE... (3 Replies)
Discussion started by: Junes
3 Replies
7. Shell Programming and Scripting
I need someone to help me out to upload script on host but I have problem can anyone help me out ? (2 Replies)
Discussion started by: spit
2 Replies
8. Shell Programming and Scripting
I get a different output when i manually run the .sh script and when it is run by a cron job. Please help me ..
TMP1="/lhome/bbuser/script/wslog/sar.t1"
TMP2="/lhome/bbuser/script/wslog/sar.t2"
TMP3="/lhome/bbuser/script/wslog/sar.t3"
OUTPUT="/lhome/bbuser/script/wslog/sar.out"... (8 Replies)
Discussion started by: nithinankam
8 Replies
9. Shell Programming and Scripting
If I run 'who -u' interactively or from a script invoked through bash in a tty on my Ubuntu 12LTS box I get an output like this:
testuser pts/0 Dec 9 02:32 . 2163 (host.xx.yy)
running the same through cron I get:
testuser pts/0 2012-12-09 02:32 00:05 2163... (2 Replies)
Discussion started by: latimer
2 Replies
10. Shell Programming and Scripting
Can I run a script no more than twice a day without using cron?
Maybe create a file when script is first run and check its date? (7 Replies)
Discussion started by: drew77
7 Replies
LEARN ABOUT CENTOS
printexc
Printexc(3) OCaml library Printexc(3)
NAME
Printexc - Facilities for printing exceptions.
Module
Module Printexc
Documentation
Module Printexc
: sig end
Facilities for printing exceptions.
val to_string : exn -> string
Printexc.to_string e returns a string representation of the exception e .
val print : ('a -> 'b) -> 'a -> 'b
Printexc.print fn x applies fn to x and returns the result. If the evaluation of fn x raises any exception, the name of the exception is
printed on standard error output, and the exception is raised again. The typical use is to catch and report exceptions that escape a func-
tion application.
val catch : ('a -> 'b) -> 'a -> 'b
Printexc.catch fn x is similar to Printexc.print , but aborts the program with exit code 2 after printing the uncaught exception. This
function is deprecated: the runtime system is now able to print uncaught exceptions as precisely as Printexc.catch does. Moreover, calling
Printexc.catch makes it harder to track the location of the exception using the debugger or the stack backtrace facility. So, do not use
Printexc.catch in new code.
val print_backtrace : Pervasives.out_channel -> unit
Printexc.print_backtrace oc prints an exception backtrace on the output channel oc . The backtrace lists the program locations where the
most-recently raised exception was raised and where it was propagated through function calls.
Since 3.11.0
val get_backtrace : unit -> string
Printexc.get_backtrace () returns a string containing the same exception backtrace that Printexc.print_backtrace would print.
Since 3.11.0
val record_backtrace : bool -> unit
Printexc.record_backtrace b turns recording of exception backtraces on (if b = true ) or off (if b = false ). Initially, backtraces are
not recorded, unless the b flag is given to the program through the OCAMLRUNPARAM variable.
Since 3.11.0
val backtrace_status : unit -> bool
Printexc.backtrace_status() returns true if exception backtraces are currently recorded, false if not.
Since 3.11.0
val register_printer : (exn -> string option) -> unit
Printexc.register_printer fn registers fn as an exception printer. The printer should return None or raise an exception if it does not
know how to convert the passed exception, and Some s with s the resulting string if it can convert the passed exception. Exceptions raised
by the printer are ignored.
When converting an exception into a string, the printers will be invoked in the reverse order of their registrations, until a printer
returns a Some s value (if no such printer exists, the runtime will use a generic printer).
When using this mechanism, one should be aware that an exception backtrace is attached to the thread that saw it raised, rather than to the
exception itself. Practically, it means that the code related to fn should not use the backtrace if it has itself raised an exception
before.
Since 3.11.2
OCamldoc 2014-06-09 Printexc(3)