i have a Shell Script A which calls Shell Script B which calls the Stored procedure within ISQL within it. The Exception in Shell Script B's Stored procedure has to be thrown back to the Original Shell Script A. Any idea how to do this?
Throwing Shell script's Stored procedure Exception Back to the Caller
75 Views Asked by AudioBubble At
2
There are 2 best solutions below
8

@narasimhakulkami : What do you mean by throwing an exception in the context of a POSIX shell script? Aside from using kill
for some suitable signal, which could be trapped by the receiving process, there is no exception mechanism available.
You could request the exception-catching process to provide its own PID in an environment variable and then do a kill
on this PID, but of course you can not communicate any additional information with this signal (such as the exact exception message), and it would be a terrible design anyway.
Here is the solution: