I have main.ksh which will call various scripts inside and let us assume script1.ksh,script2.ksh,script3.ksh,script4.ksh.
Main.ksh
Let us say script2.ksh got failed due to some reason and when I rerun the Main.ksh script It should start from script2.ksh onwards.
Actually, I have so many commands and scripts in Main.ksh.I want this restartbility for entire script and How to do this?
Moderator's Comments:
Please use CODE tags as required by forum rules!
Last edited by RudiC; 08-29-2017 at 10:04 AM..
Reason: Added CODE tags.
I have one clarification on link:-https://www.unix.com/shell-programming-and-scripting/273847-script-execution-sequence-manner.html
When job=$((job + 1)) and date "+$job %c" > status will be executed?
Case1:-Let us assume sh -x script1.sh is success and it will return 0 and it will execute else part
echo "Failed due to some reason"
Case2:-Let us assume sh -x script1.sh is failed and it will return non-zero and it will execute then part
job=$((job + 1)) and date "+$job %c" > status
It will increment the job value and also update the status.
Case1:-Let us assume sh -x script1.sh is success and it will return 0 and it will execute else part
echo "Failed due to some reason"
Case2:-Let us assume sh -x script1.sh is failed and it will return non-zero and it will execute then part
job=$((job + 1)) and date "+$job %c" > status
if (the keyword) is basically: goto then if the following command returns zero, otherwise go to the else-part. That means:
means "if the return code of sh -x script1.sh is zero". Both your scenarios cannot happen therefore, it is the other way round: if the job returns 0 then the variable $job is incremented (and the log entry is written and if it fails the script exits with 1.
Dear all,
I am working on script which call other shell scripts in a loop but problem is from second script am not able to come out.
Here is the snippet:-
#!/bin/bash
HSFILE=/root/Test/Components.txt
LOGFile=/opt/domain/AdminDomain/application/logs... (3 Replies)
Hi all, I'm wondering if you could give me some advice. I am new to scripting and am getting rather frustrated that i can get my script to call another script if certain criteria is met, via command line, but I cannot get the same script to work thru the cron jobs.
My first script monitors... (8 Replies)
Dear Members,
I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc.
I would like to create a script which will will call other scripts based on the request action.
Can we directly read from the REQUEST_ACTION... (2 Replies)
Hi,
I have to write a program to compute the checksums of files
./script.sh
I wrote the program using bash and it took me forever since I am a beginner but it works very well.
I'm getting so close to the deadline and I realised today that actually I have to use normal Bourne shell... (3 Replies)
Hi all,
I have set up a cron job which calls another shell script shell script which in turn calls a Java process. The cron tab looks so.
0,30 7-18 * * 1-5 /u01/home/weblogic/brp/bin/checkstatus.sh >> /u01/home/weblogic/logs/checkstatus.log
The checkstatus.sh scripts looks like this.
... (4 Replies)
Hi,
I've written a script that runs on a Database server. It has to shutdown the Application server, do an Oracle Dump and then restart the Application server. Its been a long time since I wrote any shells scripts. Can you tell me if the scripts that I execute within my script will be executed... (3 Replies)
Hi,
First, let me explain the issue I am trying to solve. We have a lot of expect scripts with the duplicated send/expect commands. So, I'd like to be able to extract the duplicated code into the common scripts that can be used by other scripts.
Below is my test where I am trying to call... (0 Replies)
write a script that ask the for for the user to input two
numbers and outs the sum, product, and difference f those number
the sum of X and Y is Z
the product of X and Y is Z
the difference of X and Y is Z
where x and Y are the number of input and Z is the result
I am bad at math please... (4 Replies)